×
Home Discussions Write at Opengenus IQ
×
  • DSA Cheatsheet
  • HOME
  • Track your progress
  • Deep Learning (FREE)
  • Join our Internship 🎓
  • RANDOM
  • One Liner

Algorithms

Algorithms have proven to be the most important domain over the last century which has reformed the way we do tasks. It is actively used to design industry systems and forms the building blocks of companies like Google. We cover all types of algorithms in depth

Algorithms

Minimum Comparisons to find Second Largest Element

In this article, we have demonstrated the mathematical analysis to find out the minimum number of Comparisons to find the second largest or the second smallest element.

Shreya Shah Shreya Shah
Algorithms

Xiaolin Wu's Line Drawing Algorithm

Xiaolin Wu's Line Drawing Algorithm is a recognized Line Drawing Algorithm in Computer Graphics which is used to produce Anti-aliased lines. In this article, we have explored this in depth.

Vansh Pratap Singh Vansh Pratap Singh
Algorithms

Make String Stable [using Stack]

Given a string with opening and closing braces, our problem is to find the minimum number of operations to make the string stable. This can be solved efficiently using Stack.

Sonal Agrawal Sonal Agrawal
Algorithms

Convert a binary tree into its mirror tree

Given a binary tree, we have to write an algorithm to convert the binary tree to its mirror tree. A mirror tree is another binary tree with left and right children of all non-leaf nodes interchanged.

Akshay Atam
Algorithms

Applications of Topological Sort [Explained]

In this article, we have covered various Applications of Topological Sort in depth. Topological Sort of a directed graph is a linear ordering of its vertices.

Mallika Dey
Algorithms

Time & Space Complexity of Counting Sort

In this article, we have explained the time complexity of Counting Sort for Average case, Worst case and Best case and also, covered the space complexity using Mathematical analysis.

Shreya Shah Shreya Shah
Algorithms

Find GCD of all elements in an array

In this article, we have presented an algorithm to find the Greatest Common Divisor (GCD) of all elements of an array efficiently.

Siddhant Rao
Algorithms

132 Pattern Problem [Solved]

In this article, we have explained what is 132 pattern problem and have discussed 3 different approaches to solve it in linear time O(N) where brute force approach takes O(N^3) time.

Vikram Shishupalsingh Bais Vikram Shishupalsingh Bais
Time Complexity

Time & Space Complexity of Selection Sort

In this article, you will learn about Time Complexity and Space Complexity of Selection Sort algorithm along with the complete mathematical analysis of the different cases.

OpenGenus Tech Review Team OpenGenus Tech Review Team
Algorithms

Check if a string is a subsequence of another string

In this problem, we will see how we can check whether a string is a subsequence of another string. We have solved this in O(N) time using an efficient approach.

Vasu Soni Vasu Soni
List of Mathematical Algorithms

Equilibrium Index: Find index such that sum of left sub-array = right sub-array

For a given array, we need to find an index such that sum of left sub-array = right sub-array also called the Equilibrium Index. We solve this using brute force approach O(N^2) and using prefix array in linear O(N) time.

Shreya Shah Shreya Shah
Algorithms

Finding LCM of an array of numbers

Find the LCM of the given array of positive numbers. We have explored 2 approaches: one using GCD and other without using GCD.

Aditya Kumar Saroj
Algorithms

Finding 2 elements with difference k in a sorted array

This article discusses how to check the existence of and find 2 elements with difference k in sorted array. We have explored 3 approaches and solved it in linear time O(N).

Varul Srivastava
Algorithms

Minimum number of nodes to be removed such that no subtree has more than K nodes

The article contains editorial + implementation for Finding minimum number of nodes to be removed such that no sub tree has more than K nodes.

Vikram Shishupalsingh Bais Vikram Shishupalsingh Bais
Algorithms

Number of substrings with exactly k distinct characters

In this problem, we are given a string and our job is to count the total number of substrings of the given string that contains exactly k distinct characters. We have explored 3 approaches to solve this.

Raghavendra Achar C
Algorithms

Different ways to sort a Queue

We will be discussing 4 different ways to sort a queue. This involves sorting a Queue using auxiliary array, O(1) space, using recursion and using a stack.

Tushti
Algorithms

Implementing two stacks in one array

We will demonstrate how to implement 2 stacks in one array. Both stacks are independent but use the same array. We need to make sure one stack does not interfere with the other stack and support push and pop operation accordingly.

Prnika Bakshi Prnika Bakshi
Algorithms

Reverse first K elements of Queue using Stack

To reverse the first K elements of a queue, we can use an auxiliary stack. We push the first k elements in the stack and pop() them out so and add them at the end of the queue.

Tushti
Algorithms

Time Complexity of Insertion Sort

The average code and worst case time complexity of Insertion Sort is O(N^2) and the best case time complexity is O(N). The space complexity is O(N) for N elements.

Shweta Bhardwaj
Algorithms

Intersection point of two linked lists

Given two linked lists, where the tail of the second list points to a node in the first list, find the node where both the lists intersect. We need to find the intersection point.

Akshay Atam
Algorithms

Column Sort Algorithm

Column Sort Algorithm is a non-traditional sorting algorithm for Distributed Memory Clusters (DMC) (means multiple processors). It is a generalization of odd-even merge sort and is used in a parralel system where multiple CPUs are available for use.

Varul Srivastava
Algorithms

Shift OR algorithm for String Matching

Shift OR algorithm uses bitwise techniques to check whether the given pattern is present in the string or not. It is efficient if the pattern length is lesser than the memory-word size of the machine

Raghavendra Achar C
Algorithms

Move the first element of the linked list to the end

In this problem, given a linked list, we move the first element of the linked list to the end of the linked list.

Harshita Kanal
Problems on Binary Tree

Construct Binary Tree from Inorder and Preorder traversal

We present two approaches to Construct Binary Tree from Inorder and Preorder traversal. We start with background information on constructing Binary Tree from a given traversal or a set of traversals.

Srishti Guleria Srishti Guleria
Algorithms

Variants of Stable Marriage Problem

We have explored the variants of stable marriage problem like Egalitarian Stable Matching, Minimum Regret Stable Matching, Stable marriage with ties, Stable marriage with incomplete lists and others.

Tushti
OpenGenus IQ © 2025 All rights reserved â„¢
Contact - Email: team@opengenus.org
Primary Address: JR Shinjuku Miraina Tower, Tokyo, Shinjuku 160-0022, JP
Office #2: Commercial Complex D4, Delhi, Delhi 110017, IN
Top Posts LinkedIn Twitter
Android App
Apply for Internship