GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

GradePack

One significant advantage of Heap-Sort over Merge-Sort is it…

One significant advantage of Heap-Sort over Merge-Sort is its space efficiency. What is the auxiliary (extra) space complexity of an in-place Heap-Sort?

Read Details

In Double Hashing, why must the secondary hash function h2(k…

In Double Hashing, why must the secondary hash function h2(k) be relatively prime to the table size N?

Read Details

A complete hash function typically consists of two steps. Wh…

A complete hash function typically consists of two steps. What are they?

Read Details

Which of the following represents the total running time com…

Which of the following represents the total running time complexity of the Heap-Sort algorithm?

Read Details

class Entry { private final K key; private V value; public E…

class Entry { private final K key; private V value; public Entry(K k, V v) { key = k; value = v; } // … } Why is the key field marked as final in the Entry class snippet above?

Read Details

According to the lecture slides, what is the time complexity…

According to the lecture slides, what is the time complexity of removeMin for the Sorted List implementation (assuming efficient removal from the front)?

Read Details

What is the time complexity of this insert method in a Heap…

What is the time complexity of this insert method in a Heap Priority Queue? public void insert(E key) { heap.add(key); // Step 1 upheap(heap.size() – 1); // Step 2 }

Read Details

What is the value of `parent` in the following code if j = 5…

What is the value of `parent` in the following code if j = 5? int parent = (j – 1) / 2;

Read Details

Which of the following best defines the Heap-Order Property…

Which of the following best defines the Heap-Order Property for a Min-Heap?

Read Details

public V put(K key, V value) { for (Entry e : list) { if (e….

public V put(K key, V value) { for (Entry e : list) { if (e.getKey().equals(key)) { V old = e.getValue(); e.setValue(value); return old; } } list.add(new Entry(key, value)); return null; } What is the worst-case time complexity of the put operation shown above for a map with n entries?

Read Details

Posts pagination

Newer posts 1 … 41 42 43 44 45 … 82,381 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top