inorder tree travesal without recursion – learn in 30 secfrom microsoft awarded MVP,Using Stack is the obvious way to traverse tree without recursion. Below is an algorithm for traversing binary tree using stack. See this for step wise step execution of the algorithm.
Data Structures
Detect cycle in an undirected graph-Graph cycle-The time complexity of the union-find algorithm is O(ELogV). Like directed graphs.
write a function that returns the size of the largest subtree which is also a Binary Search Tree (BST).
The Celebrity Problem – Stack – In a party of N people, only one person is known to everyone. Such a person may be present in the party, if yes
Heaps are mainly used for implementing priority queue. We have discussed below heaps in previous posts. Binary Heap Binomial Heap In terms of Time Complexity, Fibonacci Heap beats both Binary…
Practice questions for Linked List and Recursion – Linked List – Assume the structure of a Linked List node is as follows.
An Efficient Solution is to use the count of previous window, while sliding the window. The idea is to create a hash map that stores elements.
An Efficient Solution is to use the count of previous window, while sliding the window. The idea is to create a hash map that stores elements.
Cpp Algorithm-Point arbit pointer to greatest value right side node in a linked list-Linked list
Given singly linked list with every node
Detect cycle in an undirected graph-Graph cycle-The time complexity of the union-find algorithm is O(ELogV). Like directed graphs.