hw3 - 272 Homework Assignment 3 Fall 2008 Due: November...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
272 – Homework Assignment 3 Fall 2008 Due: November 24th, 5:00 PM Do not discuss the problems with anyone other than the instructor or the TA. 1. In this problem you will generate test cases for a K-ary heap using Korat. A K-ary heap is deFned as follows: A K-ary heap is a heap data structure created using a K-ary tree where each node in the tree has at most K children. A K-ary heap can be seen as a K-ary tree with two additional constraints: The shape property : All levels of the tree, except possibly the last one (deepest) are fully Flled, and, if the last level of the tree is not Flled, the nodes of that level are Flled from left to right. The heap property : The data item in each node is greater than or equal to the data items in each of its children according to some comparison predicate which is Fxed for the entire data structure. (a) Provide an array implementation of the K-ary heap where K is passed as an argument to the constructor. Write the repOK method for the K-ary heap based on the above description. Use the Fnitization method to set the range of values in the array and the value of K. An array implementation for a binary heap is provided in the Korat website which should help
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/04/2011 for the course CEN 5016 taught by Professor Workman,d during the Spring '08 term at University of Central Florida.

Page1 / 3

hw3 - 272 Homework Assignment 3 Fall 2008 Due: November...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online