We have discussed Overview of Array, Linked List, Queue and Stack. In this article following Data Structures are discussed. 5. Binary Tree 6. Binary Search Tree 7.… Read More

# Category Archives: Binary Search Tree

Inversion Count for an array indicates – how far (or close) the array is from being sorted. If an array is already sorted then the… Read More

Given an array of numbers, return true if given array can represent preorder traversal of a Binary Search Tree, else return false. Expected time complexity… Read More

Given a binary tree, we need to check it has heap property or not, Binary tree need to fulfill the following two conditions for being… Read More

I recently had interviews with Amazon.com, Bangalore. Here’s my interview experienceCoding round (1 hour): 1. Find minimum number of coins that make a given value… Read More

Given an array, how to check if the given array represents a Binary Max-Heap.Examples: Input: arr[] = {90, 15, 10, 7, 12, 2} Output: True… Read More

Accolite visited our campus for full time Software development. First round: MCQ round consists of 30 questions 30 minutes. Questions on C aptitude, four to… Read More

Given two Binary Search Trees, find common nodes in them. In other words, find intersection of two BSTs. Example: Recommended: Please solve it on “PRACTICE”… Read More

Recently walmart labs came to our campus for campus recruitment. Here is my interview experience: Round 1 (MCQ + Coding Questions) This round was conducted… Read More

Given a Binary Search Tree, write a function that takes following three as arguments: 1) Root of tree 2) Old key value 3) New Key… Read More

Amazon came to our campus a week back and procedure was as follows: Round-1- 20 easy MCQ 2 coding questions: (a)- Find next greater number… Read More

MakeMyTrip recently visited our campus. There were 4 rounds. Online Round ( 1 Hour ) This round consisted of 20 aptitude questions and 3 coding… Read More

In this article, first count of possible BST (Binary Search Trees)s is discussed, then construction of all possible BSTs. How many structurally unique BSTs for… Read More

Given a Binary Search Tree (BST) and a positive integer k, find the k’th smallest element in the Binary Search Tree. For example, in the… Read More

Given a Binary Search Tree (BST) of integer values and a range [low, high], return count of nodes where all the nodes under that node… Read More