Skip to content
Courses
DSA to Development
Machine Learning & Data Science
Generative AI & ChatGPT
Become AWS Certified
DSA Courses
Data Structure & Algorithm(C++/JAVA)
Data Structure & Algorithm(Python)
Data Structure & Algorithm(JavaScript)
Programming Languages
CPP
Java
Python
JavaScript
C
All Courses
Tutorials
Python Tutorial
Taking Input in Python
Python Operators
Python Data Types
Python Loops and Control Flow
Python Conditional Statements
Python Loops
Python Functions
Python OOPS Concept
Python Data Structures
Python Exception Handling
Python File Handling
Python Exercises
Java
Learn Java Programming Language
Java Collections
Java 8 Tutorial
Java Programs
Java Interview Questions
Java Interview Questions
Core Java Interview Questions-Freshers
Java Multithreading Interview Questions
OOPs Interview Questions and Answers
Java Exercises
Java Quiz
Java Quiz
Core Java MCQ
Java Projects
Advance Java
Spring Tutorial
Spring Boot Tutorial
Spring Boot Interview Questions
Spring MVC Tutorial
Spring MVC Interview Questions
Hibernate Tutorial
Hibernate Interview Questions
Programming Languages
JavaScript
C++
R Tutorial
SQL
PHP
C#
C
Scala
Perl
Go Language
Kotlin
System Design
System Design Tutorial
Software Design Patterns
System Design Roadmap
Top 10 System Design Interview Questions and Answers
Interview Corner
Company Preparation
Top Topics
Practice Company Questions
Interview Experiences
Experienced Interviews
Internship Interviews
Competitive Programming
Multiple Choice Quizzes
Aptitude for Placements
Computer Science Subjects
Operating System
DBMS
Computer Networks
Engineering Mathematics
Computer Organization and Architecture
Theory of Computation
Compiler Design
Digital Logic
Software Engineering
DevOps
GIT
AWS
Docker
Kubernetes
Microsoft Azure Tutorial
Google Cloud Platform
Linux
Linux Tutorial
Linux Commands A-Z
Linux Commands Cheatsheet
File Permission Commands
Linux System Administration
Linux File System
Linux Shell Scripting
Linux Networking
Linux Interview Questions
Software Testing
Software Testing Tutorial
Software Engineering Tutorial
Testing Interview Questions
Jira
Databases
DBMS Tutorial
SQL Tutorial
PostgreSQL Tutorial
MongoDB Tutorial
SQL Interview Questions
MySQL Interview Questions
PL/SQL Interview Questions
Android
Android Tutorial
Android Studio Tutorial
Kotlin For Android
Android Projects
Android Interview Questions
6 Weeks of Android App Development
Excel
MS Excel Tutorial
Introduction to MS Excel
Data Analysis in Excel
Basic Excel Formulas & Functions
Data Analysis in Advanced Excel
Workbooks
Statistical Functions
Data Visualization in Excel
Pivot Tables in Excel
Excel Spreadsheets in Python
Basic Excel Shortcuts
Mathematics
Number System
Algebra
Linear Algebra
Trigonometry
Set Theory
Statistics
Probability
Geometry
Mensuration
Logarithms
Calculus
DSA
Data Structures
Arrays
Matrix
Strings
Linked List
Stack
Queue
Tree
Heap
Hashing
Graph
Set Data Structure
Map Data Structure
Advanced Data Structure
Data Structures Tutorial
Algorithms
Analysis of Algorithms
Design and Analysis of Algorithms
Asymptotic Analysis
Asymptotic Notations
Worst, Average and Best Cases
Searching Algorithms
Linear Search
Binary Search
Searching Algorithms Tutorial
Sorting Algorithms
Selection Sort
Bubble Sort
Insertion Sort
Merge Sort
Quick Sort
Heap Sort
Counting Sort
Radix Sort
Bucket Sort
Sorting Algorithms Tutorial
Greedy Algorithms
Dynamic Programming
Graph Algorithms
Pattern Searching
Recursion
Backtracking
Divide and Conquer
Mathematical Algorithms
Geometric Algorithms
Bitwise Algorithms
Randomized Algorithms
Branch and Bound
Algorithms Tutorial
DSA Tutorial
Practice
All DSA Problems
Problem of the Day
Company Wise Coding Practice
Amazon
Microsoft
Flipkart
Explore All
GfG SDE Sheet
Practice Problems Difficulty Wise
School
Basic
Easy
Medium
Hard
Language Wise Coding Practice
CPP
Java
Python
Curated DSA Lists
Beginner's DSA Sheet
Top 50 Array Problems
Top 50 String Problems
Top 50 DP Problems
Top 50 Graph Problems
Top 50 Tree Problems
Competitive Programming
Company Wise SDE Sheets
Facebook SDE Sheet
Amazon SDE Sheet
Apple SDE Sheet
Netflix SDE Sheet
Google SDE Sheet
DSA Cheat Sheets
SDE Sheet
DSA Sheet for Beginners
FAANG Coding Sheet
Product-Based Coding Sheet
Company-Wise Preparation Sheet
Top Interview Questions
Puzzles
All Puzzles
Top 100 Puzzles Asked In Interviews
Top 20 Puzzles Commonly Asked During SDE Interviews
Data Science
Python Tutorial
R Tutorial
Machine Learning
Data Science using Python
Data Science using R
Data Science Packages
Pandas Tutorial
NumPy Tutorial
Data Visualization
Python Data Visualization Tutorial
Data Visualization with R
Data Analysis
Data Analysis with Python
Data Analysis with R
Deep Learning
NLP Tutorial
Web Tech
HTML Tutorial
CSS Tutorial
JavaScript Tutorial
PHP Tutorial
ReactJS Tutorial
NodeJS Tutorial
Bootstrap Tutorial
Typescript
Web Development Using Python
Django
Django Tutorial
Django Projects
Django Interview Questions
Flask
Flask Tutorial
Flask Projects
Flask Interview Questions
Postman
Github
Cheat Sheets
HTML Cheat Sheet
CSS Cheat Sheet
JavaScript Cheat Sheet
React Cheat Sheet
Angular Cheat Sheet
jQuery Cheat Sheet
Bootstrap Cheat Sheet
Learn Complete Web Development
Trending Now
DSA
Web Tech
Foundational Courses
Data Science
Practice Problem
Python
Machine Learning
JavaScript
System Design
Django
DevOps Tutorial
Java
C
C++
ReactJS
NodeJS
CP Live
Aptitude
Puzzles
Projects
▲
Similar Topics
DSA
22.3k+ articles
Experiences
17k+ articles
Interview Experiences
13.5k+ articles
On-Campus
3k+ articles
Amazon
1.8k+ articles
Tree
1.4k+ articles
Microsoft
800+ articles
Experienced
630+ articles
Accolite
290+ articles
Snapdeal
150+ articles
OYO
94 posts
Popular Articles
Recent Articles
Diameter of a Binary Tree in O(n) [A new method]
Last Updated: 22 May 2024
The diameter of a tree is the number of nodes on the longest path between two leaves in the tree. The diagram below shows two trees each wit
...read more
Tree
Microsoft
Amazon
Oracle
Directi
VMWare
Cadence India
Snapdeal
MakeMyTrip
Salesforce
OYO
Philips
DSA
Kahn's algorithm for Topological Sorting
Last Updated: 11 July 2024
Given a Directed Acyclic Graph having V vertices and E edges, your task is to find any Topological Sorted order of the graph.Topological Sor
...read more
Microsoft
Amazon
Flipkart
Graph
Accolite
Moonfrog Labs
OYO
Topological Sorting
DSA
Connect n ropes with minimum cost
Last Updated: 24 December 2024
Given an array arr[]of rope lengths, connect all ropes into a single rope with the minimum total cost. The cost to connect two ropes is the
...read more
Amazon
Goldman Sachs
Queue
Greedy
Heap
OYO
DSA
Similar Topics
DSA
22.3k+ articles
Experiences
17k+ articles
Interview Experiences
13.5k+ articles
On-Campus
3k+ articles
Amazon
1.8k+ articles
Tree
1.4k+ articles
Microsoft
800+ articles
Experienced
630+ articles
Accolite
290+ articles
Snapdeal
150+ articles
Find the maximum path sum between two leaves of a binary tree
Last Updated: 14 October 2024
Given a binary tree in which each node element contains a number. Find the maximum possible sum from one leaf node to another.Examples:Input
...read more
Tree
Microsoft
Amazon
Facebook
Directi
Accolite
FactSet
OYO
DSA
Print all possible words from phone digits
Last Updated: 12 April 2023
Given a keypad as shown in the diagram, and an n digit number, list all words which are possible by pressing these numbers.Before the advent
...read more
Arrays
Strings
Amazon
Flipkart
Samsung
Snapdeal
Accolite
Zoho
Mathematical
OYO
phone-keypad
Recursion
DSA
Topological Sorting
Last Updated: 23 July 2024
Topological sorting for Directed Acyclic Graph (DAG) is a linear ordering of vertices such that for every directed edge u-v, vertex u comes
...read more
Microsoft
Amazon
Morgan Stanley
Flipkart
Samsung
Graph
Accolite
Moonfrog Labs
OYO
DFS
Topological Sorting
DSA
Find a pair with given sum in a Balanced BST
Last Updated: 20 January 2025
Given a Balanced Binary Search Tree and a target sum, the task is to check if there exist a pair in BST with sum equal to the target sum. An
...read more
Amazon
VMWare
Snapdeal
Visa
Binary Search Tree
OYO
DSA
Jump Game - Minimum Jumps to Reach End
Last Updated: 25 November 2024
Given an arrayarr[]of non-negative integers. Each array element represents themaximumlength of the jumps that can be made forward from that
...read more
Amazon
Adobe
Morgan Stanley
Walmart
SAP Labs
Housing.com
Moonfrog Labs
Dynamic Programming
Mathematical
OYO
DSA
Connect nodes at same level
Last Updated: 04 October 2024
Given a binary tree, the task is to connect the nodes that are at the same level. Given an additionnextRightpointer for the same.Initially,
...read more
Tree
Microsoft
Amazon
Adobe
Google
Oracle
Flipkart
Accolite
Ola Cabs
Xome
OYO
Boomerang Commerce
DSA
Check if a Binary Tree is subtree of another binary tree | Set 1
Last Updated: 04 October 2024
Given two binary trees, check if the first tree is a subtree of the second one. A subtree of a tree T(root1) is a tree S(root2) consisting o
...read more
Tree
Microsoft
Amazon
Adobe
Morgan Stanley
SAP Labs
MakeMyTrip
OYO
Cavisson System
DSA
Diameter of a Binary Tree
Last Updated: 04 January 2025
Given a binary tree, the task is to determine the diameter of the tree. The diameter/width of a tree is defined as the number of edges on th
...read more
Tree
Microsoft
Amazon
Oracle
Directi
VMWare
Cadence India
Snapdeal
MakeMyTrip
Salesforce
OYO
Philips
DSA
Stickler Thief Editorial
Last Updated: 01 October 2024
Stickler the thief wants to loot money from a society having n houses in a single line. He is a weird person and follows a certain rule when
...read more
Arrays
Amazon
Yahoo
Walmart
Paytm
Accolite
Oxigen Wallet
Dynamic Programming
OYO
DSA
Check if a Binary Tree is BST or not
Last Updated: 14 January 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
Permutations of given String
Last Updated: 06 January 2025
Given a string s, the task is to return all permutations of a given string in lexicographically sorted order.Note: A permutation is the rear
...read more
Strings
Amazon
Samsung
Walmart
Cisco
Citrix
Snapdeal
Accolite
MAQ Software
Greedy
Backtracking
Mathematical
Combinatorial
OYO
permutation
Recursion
Apple
strings
DSA
Maximum Subarray Sum - Kadane's Algorithm
Last Updated: 11 September 2024
Given an array arr[], the task is to find the subarray that has the maximum sum and return its sum.Examples:Input: arr[] = {2, 3, -8, 7, -1,
...read more
Arrays
Microsoft
Amazon
Morgan Stanley
Oracle
Flipkart
Samsung
D-E-Shaw
Walmart
VMWare
Snapdeal
Accolite
Payu
Zoho
Hike
MakeMyTrip
Visa
Housing.com
Ola Cabs
24*7 Innovation Labs
MetLife
FactSet
Teradata
Dynamic Programming
OYO
Amazon-Question
Visa-Question
subarray
subarray-sum
DSA
1
2
3
4
5
6
7
>>
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 !