16 trees debugging soln PDF

Title 16 trees debugging soln
Author amri fazzil
Course Computation Programs And Programming
Institution The University of British Columbia
Pages 2
File Size 209.4 KB
File Type PDF
Total Downloads 38
Total Views 192

Summary

notes for this class practice material...


Description

Anthony Estey CSC 115 – BSTs

Debugging with Heaps and Trees: Assume there is a toString method that prints out the contents of the underlying array for a minimum heap. Given the outputs below, which of the following are valid minimum heaps? Array contents, beginning at index 0: null 1 25 3 41 57 4 19

Heap-Order Property: - keys ordered between parents and children (it is not a fully sorted array, and children are not ordered in any way)

1-based min-heap. Valid

Array contents, beginning at index 0: 1 6 4 5 9 12 17 18 26 0-based min=heap. Invalid HEAP-ORDER VIOLATION

Array contents, beginning at index 0: null 1 6 4 9 12 5 7 14 11 16 18 8 1-based min-heap. Valid...


Similar Free PDFs