Skip to main content

Posts

Showing posts from May, 2020

Heap and Tries

Heaps And Tries, both are a data structures algorithm concept In this blog I will be summarizing : Heap Concept Min Heap  Max Heap Min-Max Heap Heap Applications Tries Concept Tries Applications Heap is a complete binary tree which impliments the "heap" property. Heap property ?  Min Heap and Max Heap Min Heap means every node's element is smaller than its children's Max Heap means every node's element is larger than its children's Heap Applications: - Priority Queue    - Selection Algorithms   - Dijkstra's Algorithm (finding shortest path in graph)   - Prim Algorithm (finding minimum spanning tree) - Heap Sort We can also imply heap into arrays such as : Formula (x) stands for a node's position : Parent(x)=x/2 Left Child(x)=2*x Right Child(x)=2*x+1 UpHeap, is a process that swaps values between current node and it's parents while  it doesn't satisfy it's heap's property(min...