## Check if a given Binary Tree is Heap

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 »

- Max Heap in Python
- Min Heap in Python
- Real-time application of Data Structures
- Maximum Possible Rating of a Coding Contest
- Maximum CPU Load from the given list of jobs
- Sum and product of K smallest and largest Fibonacci numbers in the array
- Find Non-overlapping intervals among a given set of intervals
- Minimum cost to merge numbers from 1 to N
- Array value by repeatedly replacing max 2 elements with their absolute difference
- Count of pairs from arrays A and B such that element in A is greater than element in B at that index
- Longest subarray with absolute difference between elements less than or equal to K using Heaps
- Weak Heap
- std::is_heap( ) in C++ with Examples
- Reduce the array to atmost one element by the given operations
- Merge first two minimum elements of the array until all the elements are greater than K
- Path with smallest product of edges with weight >= 1
- Last element remaining by deleting two largest elements and replacing by their absolute difference if they are unequal
- Flattening a linked list | Set 2
- Print all the leaf nodes of Binary Heap
- Maximize jobs that can be completed under given constraint
- Complexity analysis of various operations of Binary Min Heap

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 »

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,… 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:… Read More »

A typical Priority Queue requires following operations to be efficient. Get Top Priority Element (Get minimum or maximum) Insert an element Remove top priority element… Read More »

Given an infinite stream of integers, find the k’th largest element at any point of time. Example: Input: stream[] = {10, 20, 11, 70, 50,… Read More »

Although QuickSort works better in practice, the advantage of HeapSort worst case upper bound of O(nLogn). MergeSort also has upper bound as O(nLogn) and works… Read More »

1st Round : (2 hrs) 1. Implement LRU Cache, 2. Implement your own Blocking Queue. 3. Questions on Collections , a. How AtomicInteger works b.… Read More »

Experience – 1.8years Round-1:(Technical-1:10 min) 1. Introduce yourself. 2. Deep discussion on the current project which I’m working on.(project high level architecture, questions on design,… Read More »

Accolite came to our campus for recruitment. First Round Written Test: 30 MCQs in which question related to DS Networking OS Unix commands DBMS. Questions… Read More »

Given an array and a number k where k is smaller than size of array, we need to find the k’th smallest element in the… Read More »

The main application of Binary Heap is as implement priority queue. Binomial Heap is an extension of Binary Heap that provides faster union or merge… Read More »

A Binary Heap is a Binary Tree with following properties. 1) It’s a complete tree (All levels are completely filled except possibly the last level… Read More »

Given an n x n matrix, where every row and column is sorted in non-decreasing order. Print all elements of matrix in sorted order. Example:… Read More »

There are given n ropes of different lengths, we need to connect these ropes into one rope. The cost to connect two ropes is equal… Read More »

Given an n x n matrix, where every row and column is sorted in non-decreasing order. Find the kth smallest element in the given 2D… Read More »