#include<iostream>#include<cstring>using namespace std;void swap(char &a, char &b){ char t = a; a = b; b = t;}void permutation(char ch[],int s, int e){ int i = 0; if(s > e) return; if(s == e) { for(i=0; i<=e; i++) cout<<ch[i]; cout<<endl; r... Read More
#include<iostream>using namespace std;int parent(int i){ return i/2;}int left(int i){ return 2*i;}int right(int i){ return 2*i + 1;}void swap(int &a, int &b){ int t = a; a = b; b = t;}void max_heapify(int arr[],int size, int i){ int l = left(i); int r = right(i); int large... Read More