- Sorting
- Selection sort
- Topological Sort
- Heap Sort
- huffman coding compression algo
- prims algorithm
- kruskal algorithm
- dijkstra algorithm
- coin change problem
- fractional knapsack
- disjoint sets

Data structures, Algorithms and system designs

Data structures, Algorithms and system designs

- Sorting
- Selection sort
- Topological Sort
- Heap Sort
- huffman coding compression algo
- prims algorithm
- kruskal algorithm
- dijkstra algorithm
- coin change problem
- fractional knapsack
- disjoint sets

- Get link
- Other Apps

Labels:
greedy algorithms

- Get link
- Other Apps

- Get link
- Other Apps

package com.problems.heap;publicclassHeapFunctions{//Function to generate maxheapify where root is max than childspublicvoidmaxHeapify(int Arr[],int i,int N){int largest;int left =2*i+1;//left childint right =2*i +2;//right child System.out.println("left"+" "+left); System.out.println("right"+" "+right); System.out.println("Max size"+" "+N);if(left< N && Arr[left]> Arr[i]){ largest = left; System.out.println("largest left"+largest);}else{ largest = i; System.out.println("largest i"+largest);}if(right < N && Arr[right]> Arr[largest]){ largest = right; System.out.println("largest right"+largest);}if(largest != i ){ System.out.println("No largest"+largest); Arr=swap (A…

## Comments

## Post a Comment