Font size
WorksheetsDAA MCACCA2104
Total questions: 60
Worksheet time: 32mins
In dynamic programming, the technique of storing the previously calculated values is called ___________
Saving value property
Storing value property
Memorization
Mapping
What are 2 things required in order to successfully use the dynamic programming technique?
Optimal sub structure and overlapping sub problems
A problem that can’t be sub divided and is complex
Non overlapping sub problems and intervals
Recursion and a problem that is complex
Dynamic Programming is often used for (choose all that apply):
Optimization problems that involve making a choice that leave one or more subproblems to be solved.
Problems previously solved using divide and conquer that have over lapping subproblems
Non polynomial solution problems
Subproblems where resources are shared
The difference between Divide and Conquer and Dynamic Programming is:
The division of problems and combination of subproblems
Whether the sub problems overlap or not
The way we solve the base case
The depth of recurrence
If a problem can be broken into subproblems which are reused several times, the problem possesses ____________ property.
Overlapping subproblems
Optimal substructure
Memorization
Greedy
Which of the following problems is NOT solved using dynamic programming?
0/1 knapsack problem
Matrix chain multiplication problem
Edit distance problem
Fractional knapsack problem
You are given a knapsack that can carry a maximum weight of 60. There are 4 items with weights {20, 30, 40, 70} and values {70, 80, 90, 200}. What is the maximum value of the items you can carry using the knapsack?
170
200
160
90
What order of complexity does this graph represent?
Exponential
Polynomial
Linear
Constant
What is the time complexity of this algorithm?
O(n)
O(2n)
O(log n)
O(n2)
O(1)
What order of complexity does this graph represent?
Exponential
Polynomial
Linear
Logarithmic
What order of complexity does this graph represent?
Exponential
Polynomial
Linear
Logarithmic
What order of complexity does this graph represent?
Exponential
Polynomial
Linear
Logarithmic
What is best case complexity of Insertion Sort?
Ω(n)
Ω(nlog2n)
Ω(1)
What is the worst case complexity of Quick Sort?
O(n2)
O(nlog2n)
O(n)
O(1)
What is the worst case complexity of Merge Sort?
O(n2)
O(nlog2n)
O(n)
O(1)
What is the best case complexity of Bubble sort?
Ω(n2)
Ω(n)
Ω(nlog2n)
Ω(n2log2n)
What is the worst case complexity of selection sort?
O(n2)
O(nlog2n)
O(n)
O(1)
What will be the complexity of Quick sort while data is already sorted in increasing order?
O(1)
O(n)
O(nlog2n)
O(n2)
What will be the worst case complexity of Merge Sort while data is already sorted in increasing order?
O(1)
O(n)
O(nlog2n)
O(n2)
Which one of the following sorting algorithm uses divide and conquer approach?
Selection Sort
Insertion Sort
Merge Sort
Bubble Sort
What is best case complexity of Insertion Sort?
Ω(n)
Ω(nlog2n)
Ω(1)
What is the worst case complexity of Quick Sort?
O(n2)
O(nlog2n)
O(n)
O(1)
What is the worst case complexity of Merge Sort?
O(n2)
O(nlog2n)
O(n)
O(1)
What is the best case complexity of Bubble sort?
Ω(n2)
Ω(n)
Ω(nlog2n)
Ω(n2log2n)
What is the worst case complexity of selection sort?
O(n2)
O(nlog2n)
O(n)
O(1)
What will be the complexity of Quick sort while data is already sorted in increasing order?
O(1)
O(n)
O(nlog2n)
O(n2)
What will be the worst case complexity of Merge Sort while data is already sorted in increasing order?
O(1)
O(n)
O(nlog2n)
O(n2)
Which one of the following sorting algorithm uses divide and conquer approach?
Selection Sort
Insertion Sort
Merge Sort
Bubble Sort
Which one of the following sorting algorithm always divides its data into almost two equal half ?
Selection Sort
Quick Sort
Merge Sort
Bubble Sort
Which one of the following uses divide, conquer and combine approach?
Quick Sort
Merge Sort
Selection
Counting Sort
What is the space complexity of Insertion sort?
O(n)
O(nlog2n)
O(n2)
What is the space complexity of Bubble sort?
O(n)
O(nlog2n)
O(1)
O(n2)
What is space complexity of Merge Sort?
O(1)
O(n)
O(n2)
O(nlog2n)
Which one of the following is linear sorting algorithm?
Selection sort
Merge sort
Counting sort
Bubble sort
Which one of the following is not stable sort?
Counting sort
Radix sort
Merge sort
Quick sort
Which one of the following is not a comparable sort?
Selection sort
Insertion sort
Radix sort
Quick sort
What is the complexity of counting sort?
O(n⋅k)
O(n+k)
O(n2)
O(nlog2n+k)
What is the space complexity of counting sort?
O(1)
O(n)
O(k)
O(n+k)
Which one of the following sorting algorithm cannot sort negative numbers?
Merge sort
Quick sort
Counting sort
Selection
Which one of the sorting algorithm picks the smallest element of the array and place it in beginning positions in every iteration?
Quick sort
Insertion sort
Selection sort
Bubble sort
Which one of the following uses divide, conquer and combine approach?
Quick Sort
Merge Sort
Selection
Counting Sort
What is the space complexity of Insertion sort?
O(n)
O(nlog2n)
O(n2)
3 5 9 10 23
How many comparisons would it take to find number 9?
It consists of a finite set of elements called nodes and a finite set of directed lines called branches.
Graph Data Structure
Tree Data Structure
Linked List Data Structure
Array
