×
Home Discussions Write at Opengenus IQ
×

Search anything:

  • DSA Cheatsheet
  • HOME
  • Track your progress
  • Deep Learning (FREE)
  • Join our Internship 🎓
  • RANDOM
  • One Liner

OpenGenus IQ, an open-source Computer Science Publication House, is driven by 2500+ BSc/MSc/PhD holders globally, exploring Algorithms, Deep Learning, System Design, and more since 2017.

Algorithms

Area of Polygon: Shoelace formula

Given coordinates of vertices of polygon, Area of Polygon is calculated using Shoelace formula described by Mathematician and Physicist Carl Friedrich Gauss where polygon vertices are described by their Cartesian coordinates in the Cartesian plane. The time complexity is O(N) with O(1) space

Piyush Rajendra Chaudhari Piyush Rajendra Chaudhari
Data Structures

Stack

Stack serves two principal operations: push, which adds an element to the collection, and pop, which removes the most recently added element that was not yet removed. We have covered functions like top, isFull, isEmpty, peek, pop, push and given an implementation example

Shreya Gupta Shreya Gupta
Python

Tuple in Python

Tuples in Python are used to hold together multiple objects. Tuples are defined by specifying items separated by commas within an optional pair of parentheses. Any set mutiple comma-separated symbols written default to tuples. Tuples are immutable

Shreya Gupta Shreya Gupta
C++

Virtual Function in C++

A virtual function in C++ is a member function which is declared within a base class and is overriden by a derived class. When you refer to a derived class object using a pointer or a reference to the base class, you can call a virtual function for that object and execute the derived class function

Harshita Sahai Harshita Sahai
C++

Vector in C++

Vector is a sequence container that can store elements, but its size can change dynamically (C/C++ array’s size do not change dynamically). We can store int, string, float elements, depending on how we initialize the vector.

Shreya Gupta Shreya Gupta
Algorithms

Extended Euclidean Algorithm

We will demonstrate Extended Euclidean Algorithm. We will see how you can calculate the greatest common divisor in a naive way which takes O(N) time complexity which we can improve to O(log N) time complexity using Euclid's algorithm. Extended Euclidean Algorithm takes O(log N) time complexity

Arunesh Sarker
C++

Inheritance in C++

Inheritance in C++ allows us to define a class in terms of another class, which makes it easier to create and maintain an application. This provides an opportunity to reuse the code functionality. Single, multiple, hierarchical, multilevel, multipath and hybrid inheritance is supported in C++

Kavita Bisht
C Programming

continue statement in C

The continue statement is a jump statement in C. It is another one of the jump statements like the break statement as both the statements skip over a part of the code. But the continue statement is somewhat different from the break statement. It forces the next iteration of the loop to take place

Shreya Rastogi
C++

Namespace in C++

Namespaces in C++ allow us to group named entities that otherwise would have global scope into narrower scopes, giving them namespace scope. This allows organizing the elements of programs into different logical scopes referred to by names.

Harshita Sahai Harshita Sahai
Algorithms

Multiple array range increments in linear time O(N)

Given an array a containing N integers, we perform M queries. Each query has three values START, END and a value D. For each query, the problem is to increment the values from the start to end index(both inclusive) in the given array by the given value d. An efficient algorithm takes O(N+M) time

Arvind Tatiparti
C++

Unique_ptr in C++

A unique_ptr is like a normal pointer, except the fact that it "owns" the object to which it points, as mentioned above. The word "unique" in the title refers to the fact that at a time, only one unique_ptr can point to a given object and the object is destroyed when the pointer is destroyed.

Gokulnath Pillai
Algorithms

Sieve of Atkin

Sieve of Atkin is an algorithm used to find all prime numbers upto a given number (say N) and does so in O(N) time complexity. With a modified version with enumerating lattice points variation, the time complexity goes to O(N / log log N). It is computationally efficient than Sieve of Eratosthenes

Drishti singh
Data Structures

Union Find (Disjoint Set)

A Union Find data structure (also called disjoint-set) is a data structure that keeps track of elements partitioned into a number of disjoint subsets. It provides near-constant-time operations to add new sets, to merge existing sets, and to determine whether elements are in the same set.

Sadanand Vishwas Sadanand Vishwas
C++

Program Flow control in C++

The flow of control jumps from one part of the program to another, depending on calculations performed in the program. Program statements that cause such jumps are called control statements. We have covered for, while, do while loop, if else, switch, break, continue, goto and functions.

Shreya Gupta Shreya Gupta
C++

Friend Function in C++

C++ allows a mechanism, in which a non-member function has access permission to the private members of the class. This can be done by declaring a non-member function friend to the class whose private data is to be accessed. The friend is a keyword.

Shreya Gupta Shreya Gupta
Software Engineering

Understand Inheritance in depth

Inheritance is the process by which objects of one class acquire the properties of objects of another class. It supports the concept of hierarchical classification. The different types of inheritance are single, multilevel, hierarchical, hybrid, multipath and multiple inheritance

Vaibhav Gupta
C++

Operator Overloading in C++

Operator overloading is an important concept in C++. It is a type of polymorphism in which an operator is overloaded to give user defined meaning to it. Overloaded operator is used to perform operation on user-defined data type. We give examples of unary ++, bitwise + and arithmetic + operators

Kavita Bisht
Algorithms

Area of Triangle: Heron's formula

We take a look at Heron's formula which will enable us to calculate the area of any triangle given the length of the three sides of that triangle. The advantage is that the area is calculated using arithmetic operations and hence, the time taken can be assumed to be constant,

Piyush Rajendra Chaudhari Piyush Rajendra Chaudhari
Machine Learning (ML)

Bias in Machine learning

Bias is an constant parameter in the Neural Network which is used in adjusting the output. Therefore Bias is a additional parameter which helps the model so that it can perfectly fit for the given data. It is also known as bias nodes, bias neurons, or bias units

Prashant Anand Prashant Anand
Machine Learning (ML)

Implementing CNN in Python with Tensorflow for MNIST digit recognition

In this article, we will develop and train a convolutional neural network (CNN) in Python using TensorFlow for digit recognifition with MNIST as our dataset. We will give an overview of the MNIST dataset and the model architecture we will work on before diving into the code.

Jash Sheth
Machine Learning (ML)

Logistic Regression in Python with TensorFlow

We will walk you though the difference between Linear and Logistic Regression and then, take a deep look into implementing Logistic Regression in Python using TensorFlow. We used the Iris dataset and have trained and plotted the loss function and the training and test accuracy across epochs

Leandro Baruch Leandro Baruch
C Programming

Storage classes in C

A Storage Class defines the scope (visibility) and life-time of variables and/or functions within a C Program. They precede the type that they modify. Storage classes are used in C programming are Automatic variables (auto), External variables (extern) Static variables (static) and Register variable

Kavita Bisht
Algorithms

Circle Sort

Circle sort is a sorting algorithm in which diametrically opposite elements are compared to each other and swapped with an average time complexity of O(N log N) and space complexity of O(1). It is an unstable, recursive, parallelizable, in place sorting algorithm

Ankur Sanodiya
Data Structures

K Dimensional Tree / (K D Tree)

K Dimensional tree (or k-d tree) is a tree data structure that is used to represent points in a k-dimensional space. It is used for various applications like nearest point (in k-dimensional space), efficient storage of spatial data, range search. We implemented it in C++ and explained the operations

Yash Aggarwal Yash Aggarwal
Machine Learning (ML)

Training, saving and loading Artificial Neural Networks in Keras

We demonstrate how to code a Artificial neural network model and train and save it in JSON or H5 format which can be loaded later for any inference task. We use Keras/ TensorFlow to demonstrate this transfer learning and used Pima Indian Diabetes dataset in CSV format

Jash Sheth
OpenGenus IQ © 2026 All rights reserved â„¢ [email: team@opengenus.org]
Top Posts LinkedIn Twitter