Heaps

11 flashcardsby Maria
Study these flashcardsFree · spaced repetition · iPhone, Android, Mac & web

All cards

1
The first step in Heap Sort is to put the items in what structure?
binary tree
2
What type of binary tree is used to start Heap Sort?
  • Complete Binary Tree
  • Partial Binary Tree
  • Left Balance Binary Tree
3
What is built as the initial structure in Heap Sort?
  • Heap
  • Root
  • Complete
4
Which item is repeatedly removed during Heap Sort?
  • Root
  • Heap
  • Complete
5
What process is performed after each removal in Heap Sort?
Reheap or Rebuild
6
When a binary tree is complete, using an array instead of linked nodes is a better choice.
  • TRUE
  • FALSE
7
In an array-based heap starting at index 1, when removing the heap’s largest object, you remove the root node.
  • TRUE
  • FALSE
8
In a maxheap, the object in each node is greater than or equal to the objects in the node’s ancestors.
  • FALSE
  • TRUE
9
In the array-based heap, the add method uses O(n) operations.
  • FALSE
  • TRUE
10
We can use a heap to sort an array.
  • TRUE
  • FALSE
11
Define a complete tree.
A complete tree is full to its next-to-last level, and its leaves on the last level are filled in from left to right.
Study all 11 cards for free