Skip to content
Courses
DSA to Development
Get IBM Certification
Newly Launched!
Master Django Framework
Become AWS Certified
For Working Professionals
Interview 101: DSA & System Design
Data Science Training Program
JAVA Backend Development (Live)
DevOps Engineering (LIVE)
Data Structures & Algorithms in Python
For Students
Placement Preparation Course
Data Science (Live)
Data Structure & Algorithm-Self Paced (C++/JAVA)
Master Competitive Programming (Live)
Full Stack Development with React & Node JS (Live)
Full Stack Development
Data Science Program
All Courses
Tutorials
Data Structures & Algorithms
ML & Data Science
Interview Corner
Programming Languages
Web Development
CS Subjects
DevOps And Linux
School Learning
Practice
Build your AI Agent
GfG 160
Problem of the Day
Practice Coding Problems
GfG SDE Sheet
Contests
Accenture Hackathon (Ending Soon!)
GfG Weekly [Rated Contest]
Job-A-Thon Hiring Challenge
All Contests and Events
DSA
Practice Problems
Python
C
C++
Java
Courses
Machine Learning
DevOps
Web Development
System Design
Aptitude
Projects
Sign In
▲
Similar Topics
DSA
22.3k+ articles
Experiences
17k+ articles
Interview Experiences
13.8k+ articles
Arrays
6.4k+ articles
Amazon
1.8k+ articles
Linked List
1.1k+ articles
Microsoft
780+ articles
Accolite
290+ articles
MakeMyTrip
200+ articles
Snapdeal
150+ articles
Adobe
270+ posts
Popular Articles
Recent Articles
Trapping Rain Water Problem - Tutorial with Illustrations
Last Updated: 07 April 2025
Trapping Rainwater Problem states that given an array of n non-negative integers arr[] representing an elevation map where the width of each
...read more
Arrays
Microsoft
Amazon
Adobe
D-E-Shaw
Accolite
Payu
MakeMyTrip
Stack
two-pointer-algorithm
DSA
Quick Sort
Last Updated: 17 April 2025
QuickSort is a sorting algorithm based on the Divide and Conquer that picks an element as a pivot and partitions the given array around the
...read more
Adobe
Qualcomm
Samsung
Goldman Sachs
SAP Labs
Target Corporation
HSBC
Divide and Conquer
Sorting
Quick Sort
DSA
DSA Tutorials
Detect cycle in an undirected graph
Last Updated: 07 April 2025
Given an undirected graph, the task is to check if there is a cycle in the given graph.Examples:Input: V = 4, edges[][]= [[0, 1], [0, 2], [1
...read more
Amazon
Adobe
Oracle
Flipkart
Samsung
Graph
MakeMyTrip
BFS
DFS
union-find
graph-cycle
DSA
Similar Topics
DSA
22.3k+ articles
Experiences
17k+ articles
Interview Experiences
13.8k+ articles
Arrays
6.4k+ articles
Amazon
1.8k+ articles
Linked List
1.1k+ articles
Microsoft
780+ articles
Accolite
290+ articles
MakeMyTrip
200+ articles
Snapdeal
150+ articles
Subset Sum Problem
Last Updated: 15 March 2025
Given an array arr[] of non-negative integers and a value sum, the task is to check if there is a subset of the given array whose sum is equ
...read more
Arrays
Amazon
Adobe
Drishti-Soft
subset
Dynamic Programming
Adobe-Question
DSA
Dijkstra's Algorithm to find Shortest Paths from a Source to all
Last Updated: 27 April 2025
Given a weighted undirected graph represented as an edge list and a source vertex src, find the shortest path distances from the source vert
...read more
Amazon
Adobe
Morgan Stanley
Dijkstra
Samsung
Cisco
Graph
Accolite
Vizury Interactive Solutions
Greedy
Shortest Path
DSA
Detect Cycle in a Directed Graph
Last Updated: 05 April 2025
Given the number of vertices V and a list of directed edges, determine whether the graph contains a cycle or not.Examples: Input: V = 4, ed
...read more
Microsoft
Amazon
Adobe
Oracle
Flipkart
Samsung
Graph
BankBazaar
MakeMyTrip
Rockstand
DFS
graph-cycle
DSA
Sort an array of 0s, 1s and 2s - Dutch National Flag Problem
Last Updated: 14 October 2024
Given an array arr[] consisting of only 0s, 1s, and 2s. The task is to sort the array, i.e., put all 0s first, then all 1s and all 2s in las
...read more
Arrays
Microsoft
Amazon
Adobe
Morgan Stanley
Qualcomm
Walmart
Yatra.com
Snapdeal
Paytm
Hike
MAQ Software
SAP Labs
MakeMyTrip
Ola Cabs
Sorting
DSA
Reverse words in a string
Last Updated: 18 March 2025
Given a string str, your task is to reverse the order of the words in the given string. Notethatstrmay contain leading or trailing dots(.) o
...read more
Strings
Microsoft
Amazon
Adobe
Morgan Stanley
Goldman Sachs
Cisco
Paytm
Accolite
Payu
Zoho
MAQ Software
SAP Labs
MakeMyTrip
Reverse
Wipro
school-programming
CBSE - Class 11
DSA
Queue using Stacks
Last Updated: 28 March 2025
Given a stack that supports push and pop operations, your task is to implement a queue using one or more instances of that stack along with
...read more
Microsoft
Amazon
Adobe
Morgan Stanley
Oracle
Flipkart
Goldman Sachs
D-E-Shaw
Walmart
Accolite
InMobi
MAQ Software
MakeMyTrip
InfoEdge
Stack
Queue
STL
DSA
Count Inversions of an Array
Last Updated: 01 December 2024
Given an integer array arr[] of size n, find the inversion count in the array. Two array elements arr[i] and arr[j] form an inversion if arr
...read more
Arrays
Microsoft
Amazon
Adobe
Flipkart
Myntra
BankBazaar
Divide and Conquer
Sorting
inversion
Merge Sort
Arrays
DSA
Check if a Binary Tree is BST or not
Last Updated: 17 February 2025
Given the root of abinary tree. Check whether it is a Binary Search Tree or not. A Binary Search Tree (BST) is a node-based binary tree data
...read more
Tree
Microsoft
Amazon
Adobe
Qualcomm
Walmart
VMWare
Snapdeal
Accolite
MakeMyTrip
FactSet
Binary Search Tree
OYO
Boomerang Commerce
GreyOrange
Wooker
DSA
Count set bits in an integer
Last Updated: 15 February 2025
Write an efficient program to count the number of 1s in the binary representation of an integer.Examples :Input : n = 6Output : 2Binary repr
...read more
Bit Magic
setBitCount
Adobe
Qualcomm
Samsung
Cisco
Brocade
Juniper Networks
Wipro
DSA
Search in a Sorted and Rotated Array
Last Updated: 07 December 2024
Given a sorted and rotated array arr[] of n distinct elements, the task is to find the index of given key in the array. If the key is not pr
...read more
Arrays
Microsoft
Amazon
Adobe
Flipkart
Samsung
D-E-Shaw
Snapdeal
Paytm
Hike
BankBazaar
SAP Labs
MakeMyTrip
Binary Search
FactSet
Searching
Times Internet
rotation
DSA
Reverse a Linked List
Last Updated: 18 February 2025
Given a linked list, the task is to reverse the linked list by changing the links between nodes.Examples:Input: head: 1 - 2 - 3 - 4 - NULLOu
...read more
Linked List
Microsoft
Amazon
Adobe
Qualcomm
Samsung
Snapdeal
Accolite
Zoho
SAP Labs
MakeMyTrip
Reverse
DSA
Find Middle of the Linked List
Last Updated: 04 September 2024
Given a singly linked list, the task is to find the middle of the linked list. If the number of nodes are even, then there would be two midd
...read more
Linked List
Microsoft
Amazon
Adobe
Morgan Stanley
Flipkart
Qualcomm
Samsung
VMWare
Payu
Zoho
Hike
Nagarro
MAQ Software
GE
Veritas
Wipro
Python-DSA
DSA
1
2
3
4
5
6
7
8
>>
Last
1
2
3
4
5
6
>>
Last
1
2
3
4
>>
Last
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !