DSA

How to Convert a Recursive Function or Algorithm to Non-Recursive?

Any recursive function can be converted to non-recursive function through use of a stack as explained below. A recursive call is similar to a call to another function. Any call to a function requires that the function has storage area where it can store its local variables and actual parameters. Return address must be saved …

How to Convert a Recursive Function or Algorithm to Non-Recursive? Read More »

Program for Heap Sort in C

Here you will get program for heap sort in C. It is a comparison based sorting technique which uses binary heap data structure. Below I have shared simple program to implement this sorting technique in C. Program for Heap Sort in C #include<stdio.h> void create(int []); void down_adjust(int [],int); void main() { int heap[30],n,i,last,temp; printf(“Enter …

Program for Heap Sort in C Read More »