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

Assignment Help Computer Engineering
Reference no: EM132155886

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: EM132155886

Questions Cloud

What is the probability that the outcome : A fair die is rolled twice; What is the probability that that the outcome of the second roll is greater than the outcome of the first roll?
Write a program to calculate the factorial of a number : Call a function to calculate the factorial. The input to the function is the integer n and the return value is n factorial.
What is the purpose of activity diagram : How is use case diagram related to functional modeling? How does an essential use case differ from a real use case?
What is the lower limit of the interval : Terrance want to find a 95% confidence interval for the true proportion of the population who favor the bill. What is the lower limit of the interval?
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.
What are the indices of the parent and children of a node : 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 ?
Large degree of error variance in an experiment : A researcher finds a large degree of error variance in an experiment on children's ability to remember a passage they read as a function of the number of hours
Implement secure communications between two parties : In this assignment, you will implement secure communications between two parties, Alice and Bob.
Use the checksum to verify each of the following groups : Use the checksum to verify each of the following groups of 8-bit data elements All of the data is represented in hexadecimal.

Reviews

Write a Review

Computer Engineering Questions & Answers

  What privacy issues might be a concern with bank records

ow do you plan to acquire the data? What privacy issues might be a concern with bank records (bank account numbers, customer names, etc.)?

  What would the destination address of the arp query be

Suppose a node is on the same LAN as 97.39.39.166 needs 97.39.39.166's MAC address. What would the destination address of the ARP query be (link layer)?

  What are the contents of the program counter

What are the contents of the program counter (PC), SP and TOS - contents of the top of a memory stack

  How does the fourth amendment apply to computer crimes

How have computer crimes driven changes in information technology security? How does the Fourth Amendment apply to computer crimes?

  What are the requirements for dfs

What are the requirements for DFS? What are benefits of using DFS? What are the shortcomings and limitations?

  Systems analyst at a manufacturing company in seattle

You are the Systems Analyst at a manufacturing company in Seattle, WA. A Systems Analyst in your company's New York office sends you a trace file to analyze. The complaint is that an end-users machine cannot connect to any of the network devices o..

  What tools are used to perform the test

What tools are used to perform the test? Who are the stakeholders for the test? What are the ramifications if this test fails or is not performed?

  Write a trace-handling routine that prints contents of pc

What are the differences between TRAPS, illegal instruction exceptions, and line A and line F exceptions?

  Define the cost of ownership of the mobile application

Define the cost of ownership of the mobile application. Define the benefits of ownership of the mobile application. Predict the return on investment (ROI) of the mobile application and your suggested alternatives.

  Submit a 8- to 12-slide presentation which provides a

submit a 8- to 12-slide presentation that provides a technical analysis of analog and digital technology including the

  Explain how net neutrality will affect data networks

Base on your article review and the assigned reading, discuss how net neutrality will affect data networks and the availability of information to businesses.

  Write a c program that will read the required values

Write a C program that will read the required values from the input file into two one-dimensional arrays.

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