Given a Binary Tree and a positive integer k, print all nodes that are distance k from a leaf node.
Here the meaning of distance k from a leaf means k levels higher than a
Interview Questions asked in Google, Microsoft, Amazon
by Dhaval Dave
Given a Binary Tree and a positive integer k, print all nodes that are distance k from a leaf node.
Here the meaning of distance k from a leaf means k levels higher than a
by Dhaval Dave
by Dhaval Dave
by Dhaval Dave
Input: In-order traversal in[] = {4, 2, 5, 1, 3, 6} Pre-order traversal pre[] = {1, 2, 4, 5, 3,
by Dhaval Dave
In the mathematical field of graph theory, a spanning tree T of a connected, undirected graph G is a tree that includes all of the vertices and some or all of the edges of G.
by Dhaval Dave
In graph theory, breadth-first search (BFS) is a strategy for searching in a graph when search is limited to essentially two operations: (a) visit and inspect a node of a graph; (b) gain access to
by Dhaval Dave
Depth-first search (DFS) is an algorithm for traversing or searching tree or graph data structures. One starts at the root (selecting some arbitrary node as the root in the case of a graph) and explores