×
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.

control statement

for loop control statement

A for loop allows us to write a loop that is executed a specific number of times. The loop enables us to perform n number of steps together in one line. We have provided the flow diagram, syntax and example to demonstrate for loop.

Tanya Anand Tanya Anand
control statement

do while loop control statement

A do-while loop is similar to a while loop, except the fact that it is guaranteed to execute at least one time. The do-while loop checks its condition at the bottom of the loop after one time execution of do.

Tanya Anand Tanya Anand
control statement

While loop control statement

A while loop is a control flow statement that allows code to be executed repeatedly based on a given condition. We have provided a flow chart, syntax and programming example to demonstrate while loop

Tanya Anand Tanya Anand
control statement

if-else control statement

if else is a programming construct/ concept for controlling the flow of program execution. The basic idea is to execute different code depending upon the outcome of an expression.

Tanya Anand Tanya Anand
git

How Git uses Tree data structure concepts?

We have explored how Git version control system rely on Tree data structure concepts for its internal working. We have given an overview of the various important concepts in Git such as object store, index, blobs, tree, commit, tags and others.

Aman Agarwal Aman Agarwal
bitwise operation

Bitwise Algorithm to Find the Number Occurring with Odd Frequency

We have explored the bitwise algorithm to find the only number occuring odd number of times in a given set of numbers. We have used the XOR operator to solve this problem in O(N) time complexity in contrast to the native algorithm which takes O(N^2) time complexity. The space complexity is constant.

Piyush Mishra
Graph Algorithms

Graph Representation: Adjacency Matrix and Adjacency List

A Graph is represented in two major data structures namely Adjacency Matrix and Adjacency List. This forms the basis of every graph algorithm. In this article, we have explored the two graph data structures in depth and explain when to use one of them

Piyush Mittal Piyush Mittal
bitwise operation

Maximise XOR of a given integer with a number from the given range

Given q queries each of specifies three integers x, l, r. We have to find an integer from given range [l, r] inclusive, such that it gives maximum XOR with x. All values are assumed to be positive. We will show two ways to solve this interesting problem.

Aman Agarwal Aman Agarwal
Machine Learning (ML)

Artificial Neural Networks

An Artificial Neural Network is a form of computing system that vaguely resembles the biological nervous system. It is composed of very many neurons that are centres of computation and learn by a sort of hit and trial method over the course of many epochs. ANN can be seen as a network of perceptrons

Piyush Mishra
Machine Learning (ML)

Restricted Boltzmann Machines

Boltzmann Machines are bidirectionally connected networks of stochastic processing units. It can be used to learn important aspects of an unknown probability distribution based on samples from the distribution. We explore Gibbs Sampling and Contrastive Divergence.

Piyush Mishra
Machine Learning (ML)

Perceptron, the building block of modern AI

A perceptron is an artificial neuron that essentially receives input from an input layer, processes the input with the help of an activation function (the Heaviside step function) and gives out the output in the form of either a 0 or 1. The perceptron was invented in 1957 by Frank Rosenblatt

Piyush Mishra
C Programming

Multithreading and pthread in C

In this article, we have explored how the pthread library in C can be used to implement concepts of multithreading. A thread is a single sequence stream within in a process.

OpenGenus Tech Review Team OpenGenus Tech Review Team
C Programming

Semaphore in C

Semaphore is a data handling technique which is very useful in process synchronization and multithreading. We used the POSIX semaphore library and use the functions sem_wait, sem_post, sem_open and sem_init for implementing semaphore in C.

OpenGenus Tech Review Team OpenGenus Tech Review Team
multiplication

Toom Cook method for multiplication

Multiplication of two n-digits integers has time complexity at worst O(n^2).Toom-Cook algorithm is an algorithm for multiplying two n digit numbers in Θ(c(k)n^e) time complexity. The idea is based on divide-and-conquer technique

Kyatham Srikanth Kyatham Srikanth
matrix multiplication

Cannon’s algorithm for distributed matrix multiplication

Cannon's algorithm is a distributed algorithm for matrix multiplication for two-dimensional meshes. It is especially suitable for computers laid out in an N × N mesh. The main advantage of the algorithm is that its storage requirements remain constant and are independent of the number of processors.

Kyatham Srikanth Kyatham Srikanth
matrix multiplication

Freivalds’ algorithm for verifying Matrix Multiplication

Freivalds' algorithm is a probabilistic randomized algorithm used to verify matrix multiplication. Given three n x n matrices, Freivalds' algorithm determines in O(kn^2) whether the matrices are equal for a chosen k value with a probability of failure less than 2^-k.

Kyatham Srikanth Kyatham Srikanth
matrix multiplication

Russian peasant multiplication algorithm

Russian peasant multiplication is an interesting way to multiply numbers that uses a process of halving and doubling without using multiplication operator. The idea is to double the first number and halve the second number repeatedly till the second number doesn’t become 1

Kyatham Srikanth Kyatham Srikanth
matrix multiplication

Strassen’s Matrix Multiplication algorithm

Strassen’s Matrix Multiplication algorithm is the first algorithm to prove that matrix multiplication can be done at a time faster than O(N^3). It utilizes the strategy of divide and conquer to reduce the number of recursive multiplication calls from 8 to 7 and hence, the improvement.

Kyatham Srikanth Kyatham Srikanth
C++

Most commonly used utilities in Standard Template Library in C++

This is an overview of the most commonly used utilities in Standard Template Library in C++. We have covered Iterator, Vector, Stack, Queue, Priority Queue, Map, Set and Pair utilities.

Vimal Kumar Vimal Kumar
C++

Standard Template Library in C++

Standard Template Library in C++ is a pre-defined generic implementation of most widely used data structures and algorithms. By generic implementation it means that there is a single implementation of various Classes and Functions which works with multiple datatypes by the use of templates.

Vimal Kumar Vimal Kumar
hacktoberfest

Contribute to Hacktoberfest 2018 at OpenGenus

Find super easy and effective contribution scopes at OpenGenus for Hacktoberfest 2018. It is organized by DigitalOcean, GitHub and Twilio. We are empowering developers to reach their potential at this special event.

OpenGenus Tech Review Team OpenGenus Tech Review Team
clustering algorithm

Introduction to Clustering Algorithms

clustering is an unsupervised learning problem, since it seeks to classify or divide a dataset based on attributes of the points themselves rather than any given labels.

Ronit Ray Ronit Ray
clustering algorithm

K-means Clustering

k-means clustering is a method of vector quantization, originally from signal processing, that is popular for cluster analysis in data mining. The algorithm will categorize the items into k groups of similarity, Initialize k means with random values For a given number of iterations: Iterate through

Ronit Ray Ronit Ray
clustering algorithm

DBSCAN Clustering Algorithm

Density-based spatial clustering of applications with noise is a data clustering unsupervised algorithm. The key idea is to divide the dataset into n ponts and cluster it depending on the similarity or closeness of some parameter.

Ronit Ray Ronit Ray
linked list

Flattening a Linked List

In this article, we explored an algorithm to flatten a linked list where each node has two pointers with one to another linked list. Our approach explored a novel application of the merge component of merge sort to solve this problem.

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