GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

GradePack

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

Why is sorting data a critical prerequisite for algorithms l…

Why is sorting data a critical prerequisite for algorithms like Binary Search?

Read Details

Which of the following sorting algorithms have an average-ca…

Which of the following sorting algorithms have an average-case time complexity of O(n log n)? (Select all that apply)

Read Details

What does the following upheap condition check for? while (…

What does the following upheap condition check for? while (j > 0) { int parent = (j – 1) / 2; if (heap.get(j).compareTo(heap.get(parent)) >= 0) break; // swap logic… }

Read Details

You are given the array: [ 5, 1, 4, 2, 8 ]. After two passes…

You are given the array: [ 5, 1, 4, 2, 8 ]. After two passes of the outer loop (i=1 and i=2) of an Insertion Sort, what will be the state of the array?

Read Details

Which sorting algorithm is conceptually described as “mimics…

Which sorting algorithm is conceptually described as “mimics how humans sort a hand of playing cards”?

Read Details

In all the sorting code snippets (Bubble, Insertion, Quick-S…

In all the sorting code snippets (Bubble, Insertion, Quick-Sort), we see the line: comp.compare(a, b) > 0. What is the purpose of using this comp object instead of just writing a > b?

Read Details

What is the auxiliary bspace/b complexity of an in-place Qui…

What is the auxiliary bspace/b complexity of an in-place Quick-Sort, and what is that space used for?

Read Details

What is the worst-case time complexity of Quick-Sort, and wh…

What is the worst-case time complexity of Quick-Sort, and when does it occur?

Read Details

Posts pagination

Newer posts 1 … 39 40 41 42 43 … 82,378 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top