Courses
Tutorials
Practice
Jobs
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
Invert Binary Tree - Change to Mirror Tree
Given the root of a binary tree, convert the binary tree to its Mirror tree.Note: Mirror of a Binary Tree T is another Binary Tree M(T) with left and right children of all...
Read More
Tree
DSA
Trees
Mirror Tree
Convert to Mirror
Get the Mirror
Microsoft
eBay
Amazon
Adobe
Morgan Stanley
Samsung
VMWare
Myntra
Belzabar
Snapdeal
Paytm
Accolite
SAP Labs
tree-traversal
Ola Cabs
Amazon-Question
Snapdeal-Question
Paytm-Question
Myntra-Question
eBay-Question
Prop-Tiger-Question
Belzabar-Question
OLA-Question
VMWare-Question
cpp-queue
Write a program to Delete a Tree
To delete a tree, we must traverse all the nodes of the tree and delete them one by one. So, which traversal we should use - inorder traversal, preorder traversal, or the ...
Read More
Tree
DSA
Trees
Delete Tree
tree-traversal
Maximum Depth or Height of a Binary Tree
Given the root of a binary tree, find the maximum depth of the tree. The maximum depth or height of the tree is the number of edges in the tree from the root to the deepes...
Read More
Tree
DSA
Trees
Height of a Tree
Amazon
VMWare
Cadence India
Snapdeal
Zoho
MakeMyTrip
Synopsys
tree-traversal
Monotype Solutions
CouponDunia
FreeCharge
FactSet
Teradata
Check if Two Trees are Identical
Given the roots r1 and r2 of two binary trees, determine whether they are identical.Two trees are considered identical if they have the same structure and the same node va...
Read More
Tree
DSA
Trees
Microsoft
Amazon
tree-traversal
Size of a Binary Tree
Given a binary tree, find the size of the tree. The size of a tree is the number of nodes present in the tree. Examples:Input: Output: 6Explanation: The number of nodes in...
Read More
Tree
DSA
Size of a Tree
Tree Traversal Techniques
Tree traversal refers to the process of visiting or accessing each node of a tree exactly once in a specific order. Unlike linear data structures such as arrays, linked li...
Read More
Tree
DSA
Trees
Inorder Traversal
Preorder Traversal
PostOrder Traversal
Snapdeal
tree-traversal
Tutorials
8 queen problem
Given an 8x8 chessboard, the task is to place 8 queens on the board such that no 2 queens threaten each other. Return a matrix of size 8x8, where 1 represents queen and 0 ...
Read More
Backtracking
DSA
chessboard-problems
Change/add only one character and print '*' exactly 20 times
In the below code, change/add only one character and print '*' exactly 20 times.int main(){ int i, n = 20; for (i = 0; i n; i--) printf("*"); ...
Read More
C++
c-puzzle
Condition To Print "HelloWorld"
What should be the "condition" so that the following code snippet prints both HelloWorld! if "condition" printf ("Hello"); else printf("World"...
Read More
C++
c-puzzle
Power Set
Power Set P(S) of a set S is the set of all subsets of S. For example S = {a, b, c} then P(s) = {{}, {a}, {b}, {c}, {a,b}, {a, c}, {b, c}, {a, b, c}}. If S has n element...
Read More
Mathematical
DSA
Snapdeal
Find the Missing Number
Given an array arr[] of size n-1 with distinct integers in the range of [1, n]. This array represents a permutation of the integers from 1 to n with one element missing. F...
Read More
Searching
DSA
Arrays
Microsoft
Amazon
Morgan Stanley
Qualcomm
Samsung
Cisco
Accolite
Payu
Visa
Ola Cabs
Bitwise-XOR
limited-range-elements
Implement Your Own sizeof
Here is an implementation. c #includestdio.h#define my_sizeof(type) (char *)(type+1)-(char*)(type)int main(){ double x; printf(%ld, my_sizeof(x)); get...
Read More
C++
c-puzzle
PHP Program for Largest Sum Contiguous Subarray
Write an efficient program to find the sum of contiguous subarray within a one-dimensional array of numbers that has the largest sum. Recommended: Please solve it on “PRA...
Read More
Web Technologies
PHP
PHP Programs
C# Program for Largest Sum Contiguous Subarray
Write an efficient program to find the sum of contiguous subarray within a one-dimensional array of numbers that has the largest sum.Recommended: Please solve it on “PRACT...
Read More
C#
Python Program for Largest Sum Contiguous Subarray
Write an efficient program to find the sum of contiguous subarray within a one-dimensional array of numbers that has the largest sum.Recommended: Please solve it on “PRACT...
Read More
Python
1
...
12154
12155
12156
12157