Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Below is a function to create a random numbers using an array. int * xcreateRandomDynaArray(int n) { int *dynaArray; //to create diffreent random numbers srand(time(NULL));

Below is a function to create a random numbers using an array.

int * xcreateRandomDynaArray(int n)

{

int *dynaArray;

//to create diffreent random numbers

srand(time(NULL));

//allocate space for dynamic array

dynaArray = (int *)calloc(n, sizeof(int) );

int i=0;

//the for loop to fill teh array

for (i = 0; i < n; i++ )

//add a random integer between 0-10000

*(dynaArray + i) = rand() % 10000;

return dynaArray;

}

Create a function to make a heap by inserting the numbers created from above function. After create a function which removes the data that is the root and insert it at the last position. Display the resulting array.

Please use C programmin language

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke, David J. Auer

7th edition

133544621, 133544626, 0-13-354462-1, 978-0133544626

More Books

Students also viewed these Databases questions