×
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

Smallest Missing Positive Integer

The problem is to find out the smallest missing positive integer given an unsorted integer array. We can solve this problem in linear time O(N) and in constant time O(1) using a greedy approach with hash map.

Anisha Jain
Algorithms

Partition a set into two subsets such that sum of each subset is same

An analysis and explanation of the solution for the partition problem, in which a set of numbers is to be divided into two sub arrays such that their sum is equal, by using dynamic programming.

Reetika Poosarla
Algorithms

Find the smallest element in an array

We are given an integer array of size N or we can say number of elements is equal to N. We have to find the smallest/ minimum element in an array. The time complexity to solve this is linear O(N) and space complexity is O(1).

Srashti Mittal Srashti Mittal
Algorithms

Find the longest increasing subsequence using Fenwick Tree

You are given an array of length N. You have to find the longest increasing subsequence from the given array. We will try to solve this problem using Fenwick Tree which will take O(N logN) time complexity.

Shubham Kumar Shubham Kumar
Software Engineering

Huffman coding vs Shannon Fano Algorithm

Huffman coding and Shannon Fano Algorithm are two data encoding algorithms and in this article, we have explored the differences between the two algorithms in detail.

Sonali Singhal
Software Engineering

Types of Data Encoding Algorithms

We have explored the types of Data Encoding algorithms. Data Encoding is the process of conversion of data in a form suitable for various types of information processing. Encoding is used for data transmissions, data storage, and data compression.

Sonali Singhal
Algorithms

Find Maximum Perimeter of a Triangle

Given an array of integers, find which three elements form a non-degenerate triangle such that the triangle has maximum perimeter. This can be done using a Greedy algorithm by sorting the array of integers.

Nikita Masand Nikita Masand
Algorithms

Make N numbers equal by incrementing N-1 numbers

Given an array, find the minimum number of operations to make all the array elements equal. The operation includes incrementing all but one element of the array by 1.

Nikita Masand Nikita Masand
Algorithms

Distributing Candies equally

In this problem, we need to candies from N boxes each of which has different number of candies across K friends. This problem can be solved using Binary Search.

Nikita Masand Nikita Masand
Software Engineering

Non-Preemptive Priority CPU Scheduling Algorithm

In Non-preemptive Priority CPU Scheduling Algorithm, processes are scheduled as per the priorities assigned to respective task and next process is not schedule until and unless current execution of process is not completely finished.

Piyush Rajendra Chaudhari Piyush Rajendra Chaudhari
Software Engineering

First Come First Serve CPU Scheduling Algorithm

First Come First Serve (FCFS) is also known as First In First Out (FIFO) scheduling algorithm is the easiest and simplest CPU scheduling algorithm where the process which arrives first in the ready queue is executed first by the CPU.

Piyush Rajendra Chaudhari Piyush Rajendra Chaudhari
Algorithms

Finding all Armstrong Numbers in a given range

In this article, we will develop an approach to find all armstrong numbers in a given range. The approach is to check for each number in the range if it is an armstrong number or not.

SRISTI DAKSHIT
Machine Learning (ML)

Value Iteration Algorithm (with a 1D example)

In this article, we have explored Value Iteration Algorithm in depth with a 1D example. This algorithm finds the optimal value function and in turn, finds the optimal policy.

Arathy Rose Tony
Algorithms

Minimum number of characters to be deleted to make string a palindrome

In this problem, we have to formulate an algorithm to find the minimum number of characters to be deleted to make the string a palindrome. This can be solved using the Dynamic Programming approach for longest palindromic subsequence in O(N^2) time.

Shujaa Ahmad Shujaa Ahmad
Algorithms

Split a number into K unique parts such that their GCD is maximum

The problem is to split a number N into K unique parts such that the sum of the parts is equal to N and the greatest common divisor of the K parts is maximum. This can be solved in O(N^1/2) time complexity using a greedy approach.

Sushil Sarwade
Algorithms

Topological Sorting using Kahn's Algorithm

We have explored topological sorting using Kahn's algorithm. The basic idea is that a DAG G has at least one vertex with in-degree 0 and one vertex with out-degree 0.

Shradha Sehgal
Algorithms

Fundamentals of Euler path in Graph Theory

In this article, we have explored the basic ideas/ terminologies to understand Euler Path and related algorithms like Fleury's Algorithm and Hierholzer's algorithm.

Sourajeet Mohanty Sourajeet Mohanty
Algorithms

Largest Palindromic Number by Rearranging Digits

Given N (very large), we need to find the largest palindromic number by rearranging digits. If it is not possible to print the largest palindromic number from N then, print "Palindrome not found".

Aryan Sapra
Algorithms

Smallest Palindrome greater than N using the same set of digits

We are given an number and we have to find the smallest pallindrome number greater than N which can be formed by using the same set of digits as in N. We have solved this using a Greedy approach in linear time.

Yash Kedia Yash Kedia
Algorithms

Closest string such that no two consecutive characters are same

We are given a string and we have to find the closest string such that no two characters in the string are same. This problem can be solved using a simple greedy approach which will take linear time O(N) and constant space O(1).

Yash Kedia Yash Kedia
Algorithms

Longest Palindromic Substring using Dynamic Programming

In this article, we have explored the longest palindromic substring problem for which brute force takes O(N^3) time while a Dynamic Programming approach takes O(N^2) time.

K. Sai Drishya K. Sai Drishya
Algorithms

Number of ways to reach a given number using increments of 1 and 2

The problem we will try to solve is to find the Number of ways to reach a given number (or a score in a game) using increments of 1 and 2 with consecutive 1s and consecutive 2s allowed. This is solved in linear time O(N) using Dynamic Programming.

K. Sai Drishya K. Sai Drishya
Algorithms

Find the Longest Increasing Odd Even Subsequence

In this problem, we have formulated an algorithm to find the Longest Increasing Odd Even Subsequence. Brute force approach takes exponential time O(2^N) but a Dynamic Programming approach takes O(N^2) time.

Shubham Kumar Shubham Kumar
Algorithms

Find the Longest Common Increasing Subsequence

In this problem, we have formulated an algorithm to find the Longest Common Increasing Subsequence. Brute force approach takes exponential time but a Dynamic Programming approach takes O(N^2) time.

Shubham Kumar Shubham Kumar
Algorithms

Minimum characters added to the front of string to make it palindrome

In this problem, we have to formulate an algorithm to find the minimum number of characters to be added to the front of a string to make it a palindrome. To solve this efficiently in linear time O(N), we have to use longest prefix suffix of Knuth Morris Pratt pattern matching algorithm.

Shujaa Ahmad Shujaa Ahmad
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