Chetan Dattachetan77.hashnode.dev·11 hours agoHeap ImplementationBrief What is heap? A heap is a complete binary tree that follows the heap order property. What is Complete Binary Tree (CBT)? A complete binary tree is a binary tree in which every level is completely filled except for the last level. Nodes are ...DiscussLeetcodeheapify

Chetan Dattachetan77.hashnode.dev·Sep 7, 2024Kth Largest Element in an ArrayProblem Given an integer array nums and an integer k, return the k<sup>th</sup> largest element in the array. Note that it is the k<sup>th</sup> largest element in the sorted order, not the kth distinct element. Can you solve it without sorting? (lin...DiscussLeetcodekth-largest-element-in-an-array

Saurav Maheshwarixauravww.hashnode.dev·Sep 5, 2024Top Techniques to Identify the K-th Largest ElementGiven an integer array nums and an integer k, return the k-th largest element in the array. Note that it is the k-th largest element in the sorted order, not the k-th distinct element. Example 1: Input: nums = [3,2,1,5,6,4], k = 2 Output: 5 Example ...DiscussData Structures and AlgorithmsDSA

Fatima Jannatmahia.hashnode.dev·Aug 18, 2024What is Binary Heap?If you're new to this blog, it would be great if you could check out the posts on Binary Trees, BSTs, and AVLs. Binary Tree , BST, AVL Let's get started! A Binary Heap is a Binary Tree with following properties: A binary heap can be a Min heap or Ma...DiscussPython Data Structure and Algorithmheap

Akshaya Biswalakshaya-biswal.hashnode.dev·Aug 17, 2024Heap DSA heap is a specialized binary tree-based data structure that satisfies the heap property. Max-Heap: In a max-heap, for any given node I, the value of I is greater than or equal to the values of its children. The largest value is at the root. Min-H...DiscussData Structures and Algorithms in JavaScriptDSA

Siddhant Visputesidblogs.hashnode.dev·Jul 23, 2024Heap wants some space!So recently I wanted to perform a memory analysis on a heap dump of whooping 5GB using Eclipse’s Memory Analyzer Tool (MAT). My Eclipse IDE fainted just by the idea of opening up and parsing this gigantic dump file. One of the option here is to incre...Discuss·20 likes·49 readsheapspace

Neelesh Joshineeltyper001.hashnode.dev·Jul 23, 2024Stack Memory and Heap Memory in JavascriptIn JavaScript, stack and heap memory are used to manage the allocation and deallocation of memory for variables, objects, and functions. Here's a concise overview: Stack Memory Characteristics: Fast Access: Memory allocation and deallocation follow ...DiscussJavaScript

Priya Ranjanpriyaranjan001.hashnode.dev·Jul 18, 2024Memory management in javaMemory management in Java 2 types of memory 1) Stack 2) Heap Stack memory: ---Stores temporary variables and separate memory block for methods. --- Store primitive data types --- Store Reference of heap objects. 1) Strong reference 2)Weak references ...DiscussJava

Vineeth Chivukulavineethchivukula.hashnode.dev·Jul 12, 2024Solving Merge k Sorted ListsTo see the question, click here. Naive Approach The idea is to store all the values of the list nodes in an array, sort them using the Arrays.sort method, and then construct the linked list to return it as the answer. // TC: O(nlogn) // SC: O(n) imp...Discussmerge-k

Vineeth Chivukulavineethchivukula.hashnode.dev·Jul 10, 2024Solving Kth Largest Element in an ArrayTo see the question, click here. Naive Approach To find the kth largest element, we can first sort the array and then return the nums.length - k th element. // TC: O(nlogn) // SC: O(1) import java.util.Arrays; class KthLargestElement { public ...Discusskth-largest-element