ProDeveloperTutorialonAugust 28, 2026 Heap: Find median in a stream Problem Statement: You are given a data stream, you need to get the median of the elements after each integer is read. Median can be found by:…
ProDeveloperTutorialonAugust 28, 2026 Heap: Given a BST, convert into Min Heap Problem Statement: Given a BST that is a complete binary tree, you need to convert into Min Heap. What is a BST ? A binary tree that satisfies…
ProDeveloperTutorialonAugust 28, 2026 Heap: Given two max heaps, merge them Problem Statement: You are given 2 max heaps. You need to merge them into a single max heap Example: Solution 1: Using Priority Queue Take a…
ProDeveloperTutorialonAugust 28, 2026 Heap: Given an array and a value K, return the kth smallest element Problem Statement: Given an array and a value K, return the kth smallest element Example: Input: arr = [3, 6, 1, 2, 7, 8] k = 2 Output: 2…
ProDeveloperTutorialonAugust 28, 2026 Heap: Max Heap and Min heap using Priority Queue In this chapter we will learn about priority queue. Priority Queue is a data structure, where each element is associated with a priority…
ProDeveloperTutorialonAugust 28, 2026 Heap: Heap Sort In this chapter we will learn about heap sort. To know the basic of Heap, checkout the previous chapters. Below are the steps followed for…
ProDeveloperTutorialonAugust 28, 2026 Heaps Introduction Heap is a complete binary tree and is a type of Data Structure. Heap satisfies a heap order property. A binary tree, is a complete binary tree…
ProDeveloperTutorialonAugust 28, 2026 Recursion: Given a number, count the number of set bits using recursion Problem Statement: Given a number, count the number of set bits using recursion Example: Input: 21 Output: 3 Solution Explanation: We will use…
ProDeveloperTutorialonAugust 28, 2026 Recursion: Handshake problem Problem Statement: You are given a number N, that will represents number of people at the party. You need to find the total number of…
ProDeveloperTutorialonAugust 28, 2026 Recursion: Given 2 numbers find the product of the numbers, using recursion Problem Statement: Given 2 numbers find the product of the numbers, using recursion Example: Input: m = 10 n = 2 Output: 20 Solution…