You are on page 1of 3

1. Which one below matches the principle of tower of Hanoi?

1 point

a. Stack
b. Queue
c. Non-linear data structure
d. Array

2. What is an entity set? 1 point


a. All sorts of entities
b. Entities with same attributes
c. Entities with different properties
d. Entities with the same properties

3. If deletion occurs from "top", what will you write in pop() function? 1 point

a. top++
b. top- -
c. pop(top)
d. top=-1

4. In case of array implementation, stack can run into a situation where it will not be able to
insert new elements. 1 point

a. True
b. False

5. You have a queue, initially empty. You perform a sequence of operations: enqueue(5),
enqueue(3), dequeue(), dequeue(), enqueue(4). What will be the order of elements in the queue
after these operations? 1 point

a. 4
b. 5, 3, 4
c. 5
d. 5, 4

6. Which condition tells us that the queue is full? 2 points


a. "front" and "rear" both have the same value, -1
b. "front" and "rear" both point to the same index, and it's not the first index of the array
c. "front" is -1 and "rear" is any index
d. "front" points to the first index and "rear" points to the last index
7. Which data structure is used to implement the undo-redo functionality in text editors? 1 point

a. Array
b. Linked List
c. Queue
d. Stack

8. If I call top() function, value of top will be? 1 point


Captionless Image
a. 0
b. 1
c. 2
d. 3

9. Which data structure does not provide insertion and deletion operations? 1 point

a. Array
b. Linked List
c. Stack
d. Dequeue

10. Which data structure follows the Last-In-Last-Out (LILO) principle? 1 point

a. Array
b. Linked List
c. Stack
d. Queue

11. If you have two stacks, how can you create a queue using those stacks? 1 point

a. combine the stacks using their closed ends and restrict push() on one stack, restrict
pop() on another.
b. combine the stacks using their opened ends and restrict push() on one stack, restrict
pop() on another.
c. Impossible
d. Another stack is needed

12. In case of array implementation, queue creates unused index spaces with time because of
deletion of elements. 1 point
a. True
b. False
13. If deletion occurs from "rear", what will you write in dequeue() function? 1 point

a. rear = rear +1
b. front = front -1
c. front = front +1
d. rear = rear -1

14. Which data structure ensures that the first element inserted is the first one to be removed?

1 point

a. Array
b. Linked List
c. Stack
d. Queue

15. What does Top() function do in stack? 1 point

a. insertion
b. deletion
c. update
d. returns topmost element

16. Which of the following data structures stores elements in a linear manner? 1 point

a. Tower of Hanoi
b. Linked List
c. tree
d. Queue

17. Which item(s) below can not be a group data item? 2 points

a. NID number
b. Name
c. Age
d. Address

You might also like