Write in pseudo-code the siftdown algorithm for a min-heap

Assignment Help Computer Engineering
Reference no: EM132155856

Use only C programming language for the following questions, only need to answer question 1 and 3

1. Write in pseudo-code the siftdown algorithm for a min-heap.

2. A ternary max-heap is similar to the binary max-heap that we have discussed in class, but now non-leaf nodes can have 3 children instead of 2.

(i) A ternary max-heap can be represented using an array. What are the indices of the parent and children of a node at index i ? (ii) Write in pseudocode the siftdown algorithm for a ternary max-heap.

3. Show that the alogorihm in Question 2(ii) has worst-case complexity O(log n), where n is the length of the array.

Reference no: EM132155856

Questions Cloud

Find the expected cost per loss : The loss random variable X has an exponential distribution with mean 1 and an ordinary deductible is applied to all losses.
Treatment has a significant effect : Use a one-tailed test with a = 0.05. Can you show me how it is done please?
Different preferences for features of smartphones : Do males and females have different preferences for features of smartphones? A manufacturer surveys a sample of males and females about their preference
Find the z-score for testing the hypothesis : The 95% confidence interval for the proportion of the population who favor brand A. Next, find the z-score for testing the hypothesis of no brand preference.
Write in pseudo-code the siftdown algorithm for a min-heap : A ternary max-heap is similar to the binary max-heap that we have discussed in class, but now non-leaf nodes can have 3 children instead of 2.
Selecting a sample for experiment : A researcher is randomly selecting a sample for his experiment from a group of 30 high school students, 20 college students, and 10 graduate students.
Find the prime factorization of a number : Write a function that takes as a parameter a positive integer and returns a list (array) of the prime factors of the given integer.
Determining the expected value of gain : What's the expected value of your gain? What's the expected value if you buy two tickets?

Reviews

Write a Review

Computer Engineering Questions & Answers

  How does a dual-slope a-d converter work

What is Shannons sampling criterion? How does a successive approximation A/D convener work?

  Create an array that represents recommended ratings

Create an array that represents recommended ratings for the user. There should be 20 numbers in this array, one for each movie.

  Determine a persons intoxicated condition when operating

In your opinion should the legally intoxicated percentage be lowered or raised to determine a persons intoxicated condition when operating a motor vehicle?

  Determine the conceptual model that you would use

Multi-Touch Screens vs. Mouse-Driven Screens- Determine the conceptual model that you would use when designing a product for your restaurant.

  Computer platformscomputer systems may be classified into

computer platformscomputer systems may be classified into two categories classical and quantum. this assignment will

  Questionprogramming assignment on bstthis program requires

questionprogramming assignment on bstthis program requires you to apply a binary search tree with the following

  What is the model of the hp touchsmart machine

What is the model of the HP TouchSmart machine that you have problem with?

  Show both the subscript of the largest item in arr

show both the subscript of the largest item in arr. want help with writing a program that: Lets arr be an array of 20 integers

  Write the content of the array to a second file

Use a second loop to sum the values stored in the array after the prices of all the books have been read. Write the content of the array to a second file.

  Why is erm becoming more important to organizations

What is ERM? Why is ERM becoming more important to organizations? How is ERM expected to grow in importance in the future?

  What is the minimum time required to distribute the file

The download rate of each peer is 4,000 bits/sec. What is the minimum time required to distribute the file to all the peers under the peer-to-peer model ?

  Detecting hidden files on suspect drive with forensics tools

What procedures are used by the suspect in order to hide the files on suspect drive, or formatted media and how does computer forensics investigator examine the hidden, password protected or the encrypted files with forensics tools?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd