Final Practice

Quiz
•
Computers
•
University
•
Medium
Remo Mahmoud
Used 4+ times
FREE Resource
7 questions
Show all answers
1.
FILL IN THE BLANK QUESTION
1 min • 1 pt
Consider the array representation of a binary min-heap containing 1023 elements. The minimum number of comparisons required to find the maximum in the heap is
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider a binary tree T in which every node has either zero or two children. Let n be the number of nodes in T. Which one of the following is the number of nodes in T that have exactly two children?
3.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Select all that apply to the following tree:
Binary search tree
Full complete binary tree
Heap
Proper binary tree
Complete binary tree
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the most accurate time complexity in the worst case scenario in terms of big-O notation for searching for an entry in a multi-way search tree with n nodes.
O(logn)
O(n)
O(nlogn)
O(1)
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A meld operation on two instances of a data structure combines them into one single instance of the same data structure. Consider the following data structures:
A. Unsorted doubly linked list.
B. Sorted doubly linked list
C. Min-heap implemented using an array.
Which one of the following options gives the worst-case time complexities for the meld operation on two instances of combined size n for each of these data structures?
A. O(1)
B. O(n)
C. O(n)
A. O(1)
B. O(n^2)
C. O(nlogn)
A. O(n)
B. O(n^2)
C. O(n)
A. O(1)
B. O(n)
C. O(nlogn)
6.
OPEN ENDED QUESTION
3 mins • 1 pt
Draw the resulting (2,4) tree after removing 2 (since you can't actually draw here, simply draw your solution on scratch paper, type anything here, then check your solution with the correct answer).
Evaluate responses using AI:
OFF
Answer explanation
This is one of two possible solutions. The other solution looks similar except the node with 4 in it has 3 and the node with 1 3 in it has 1 and the node with 5 in it has 4 5
7.
OPEN ENDED QUESTION
3 mins • 1 pt
Write the code for the mergeSort(S) algorithm which takes an vector S of integers and returns a sorted vector Q. Assume the merge(S1, S2, S) method (which takes two sorted vectors S1 and S2 and returns a merged sorted vector S) is already implemented and you can just use it.
Evaluate responses using AI:
OFF
Answer explanation
Vector mergeSort(S) {
if (S.size() <= 1) return S;
Vector S1, S2;
Vector::Iterator p = S.begin();
for (int i = 0; i < S.size()/2; i++)
S1.insertBack(*p++);
for (int i = n/2; i < n; i++)
S2.insertBack(*p++);
mergeSort(S1);
mergeSort(S2);
merge(S1, S2, S);
return S;
}
Similar Resources on Wayground
10 questions
searching quiz

Quiz
•
University
10 questions
CSS TECH TRIVIA - MEDIUM LEVEL

Quiz
•
University
11 questions
Data Structures - Training: Quiz 1

Quiz
•
University
6 questions
Razom Random

Quiz
•
KG - Professional Dev...
10 questions
Classification

Quiz
•
University
10 questions
C++ operator overloading

Quiz
•
University
10 questions
10 Questions of Machine Learning

Quiz
•
University
10 questions
Quiz 2 Chapter 3 PLC

Quiz
•
University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University