Skip to content

GitMasterJatin/hello

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

#include #include #include using namespace std;

void heapSort(int arr[], int n) { vector v(arr, arr + n);

make_heap(v.begin(), v.end());

sort_heap(v.begin(), v.end());

copy(v.begin(), v.end(), arr);

}

int main() { int arr[] = { 60, 20, 40, 70, 30, 10 }; int n = sizeof(arr) / sizeof(arr[0]);

heapSort(arr, n);

cout << "Sorted array is \n";
for (int i = 0; i < n; ++i)
	cout << arr[i] << " ";
cout << endl;

}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published