Kingdom of Saudi Arabia
Ministry of Education
Prince Sattam Bin Abdulaziz University وزارة اﻟﺘﻌﻠﯿﻢ
College of Computer ﺟﺎﻣﻌﺔ اﻻﻣﯿﺮ ﺳﻄﺎم ﺑﻦ ﻋﺒﺪ اﻟﻌﺰﯾﺰ
Engineering and sciences ﻛﻠﯿﺔ ھﻨﺪﺳﺔ وﻋﻠﻮم اﻟﺤﺎﺳﺐ
Department of Computer Sciences ﻗﺴﻢ ﻋﻠﻮم اﻟﺤﺎﺳﺐ
Course Title and Code:
:اﻟطﺎﻟﺑﺔ/اﺳم اﻟطﺎﻟب
Data Structures and Algorithms, CS2321 Improvement
Instructor Name:Dr. Mahdi Khemakhem & Mrs Quiz
:اﻟرﻗم اﻟﺟﺎﻣﻌﻲ
Jabeen Hussain Semester I
Date: December 21, 2017 1438/1439
:رﻗﻢ اﻟﺸﻌﺒﺔ
Time: 30 minutes
Answer all the questions. each carry 0.25 mark. write the answers in the table given below. Only one
answer for each question.
1 2 3 4 5 6 7 8 9 10 11 12
d d d c b a c b c a c a
1. In which of the following tree, parent node has a key value greater than or equal to the key value of
both of its children?
a. Binary search tree
b. Threaded binary tree
c. Complete binary tree
d. Max-heap
2. The operation to delete the minimum in a binary heap of n nodes and h levels has a time complexity
equal to:
a. O(1).
b. O(n).
c. O(h).
d. O(log n).
3. The insertion algorithm in a binary heap of n nodes has a running time equal to:
a. O(1).
b. O(n).
c. O(h).
d. O(log n).
4. In a Min-heap
a. Minimum values are stored.
b. Child nodes have less value than parent nodes.
c. Parent nodes have less value than child nodes.
d. Maximum value is contained by the root node.
5. Heap is an example of
a. Balanced binary search tree
b. Complete binary tree
c. Complete binary search tree
d. Binary search tree
6. What are the correct intermediate steps of the following data set when it is being sorted in increasing
order with the Insertion sort? 15,20,10,18
a. 15,20,10,18 -- 10,15,20,18 -- 10,15,18,20 -- 10,15,18,20
b. 15,18,10,20 -- 10,18,15,20 -- 10,15,18,20 -- 10,15,18,20
c. 15,10,20,18 -- 15,10,18,20 -- 10,15,18,20
d. 10, 20,15,18 -- 10,15,20,18 -- 10,15,18,20
Data Structures and Algorithms, CS2321– Quiz, Semester 1, 2017/2018 Page: 1 of 2
Ministry of Education
Prince Sattam Bin Abdulaziz University وزارة اﻟﺘﻌﻠﯿﻢ
College of Computer ﺟﺎﻣﻌﺔ اﻻﻣﯿﺮ ﺳﻄﺎم ﺑﻦ ﻋﺒﺪ اﻟﻌﺰﯾﺰ
Engineering and sciences ﻛﻠﯿﺔ ھﻨﺪﺳﺔ وﻋﻠﻮم اﻟﺤﺎﺳﺐ
Department of Computer Sciences ﻗﺴﻢ ﻋﻠﻮم اﻟﺤﺎﺳﺐ
Course Title and Code:
:اﻟطﺎﻟﺑﺔ/اﺳم اﻟطﺎﻟب
Data Structures and Algorithms, CS2321 Improvement
Instructor Name:Dr. Mahdi Khemakhem & Mrs Quiz
:اﻟرﻗم اﻟﺟﺎﻣﻌﻲ
Jabeen Hussain Semester I
Date: December 21, 2017 1438/1439
:رﻗﻢ اﻟﺸﻌﺒﺔ
Time: 30 minutes
Answer all the questions. each carry 0.25 mark. write the answers in the table given below. Only one
answer for each question.
1 2 3 4 5 6 7 8 9 10 11 12
d d d c b a c b c a c a
1. In which of the following tree, parent node has a key value greater than or equal to the key value of
both of its children?
a. Binary search tree
b. Threaded binary tree
c. Complete binary tree
d. Max-heap
2. The operation to delete the minimum in a binary heap of n nodes and h levels has a time complexity
equal to:
a. O(1).
b. O(n).
c. O(h).
d. O(log n).
3. The insertion algorithm in a binary heap of n nodes has a running time equal to:
a. O(1).
b. O(n).
c. O(h).
d. O(log n).
4. In a Min-heap
a. Minimum values are stored.
b. Child nodes have less value than parent nodes.
c. Parent nodes have less value than child nodes.
d. Maximum value is contained by the root node.
5. Heap is an example of
a. Balanced binary search tree
b. Complete binary tree
c. Complete binary search tree
d. Binary search tree
6. What are the correct intermediate steps of the following data set when it is being sorted in increasing
order with the Insertion sort? 15,20,10,18
a. 15,20,10,18 -- 10,15,20,18 -- 10,15,18,20 -- 10,15,18,20
b. 15,18,10,20 -- 10,18,15,20 -- 10,15,18,20 -- 10,15,18,20
c. 15,10,20,18 -- 15,10,18,20 -- 10,15,18,20
d. 10, 20,15,18 -- 10,15,20,18 -- 10,15,18,20
Data Structures and Algorithms, CS2321– Quiz, Semester 1, 2017/2018 Page: 1 of 2