In this post, we will see how to implement a stack data structure using queue in C++ and Java. In other words, design a stack that supports push and pop operations using standard enqueue and dequeue operations of the queue.
In this post, we will see the difference between Depth first search (DFS) and Breadth first search (BFS) algorithm which are used to traverse/search tree or graph data structure.
Given a binary tree, efficiently print all nodes between two given levels in a binary tree. The nodes for any level should be printed from left to right.
In this post, we will see how to implement a queue using stack data structure in C++ and Java. In other words, design a queue that supports enqueue and dequeue operations using standard push and pop operations of the stack.
Given a multilevel linked list, convert it into a singly linked list in such a way that all nodes of first level appears first, followed by all nodes of second level, and so on. The multilevel linked list is similar to the simple linked list except that it has one extra field which points to …
Given a weighted digraph (Directed Graph), find the least cost path from given source to destination that have exactly m edges.
Given a weighted graph, find the maximum cost path from given source to destination that is greater than a given integer x. The path should not contain any cycles.
Given a binary tree, write an efficient algorithm to print right view of given binary tree.
In this post, we will see how to traverse the given directory and list out all files present in it and all its sub-directories.
Given a binary tree, write an efficient algorithm to compute maximum width of it.
Given a binary tree, write an efficient algorithm to invert binary tree.
Given a Maze in the form of a rectangular matrix, filled with either O, X or M, where O represents an open cell, X represents a blocked cell and M represents landmines in the maze, we need to find shortest distance of every open cell in the maze from its nearest mine.