Data Structures and Algorithms 1 Complete Midterm by Mhel

Download as pdf or txt
Download as pdf or txt
You are on page 1of 33

MIDTERM QUIZ 1 10/10

MIDTERM QUIZ 2 10/10


MIDTERM EXAM 50/50
Question 1
Complete
Mark 10.00 out of 10.00

Flag question

Question text

Fill in the following table, using Big-O notation to give the worst and average-case times for
each of the stack methods for a stack of size N.
OPERATION WORST-CASE TIME AVERAGE-CASE TIME
constructor O(1) O(1)
Answer Answer
empty O(1) O(1)
Answer Answer
size O(1) O(1)
Answer Answer
push O(N) O(1)
Answer Answer
pop O(1) O(1)
Answer Answer
peek O(1) O(1)
Answer Answer
PS: LETTER O PO YAN HINDI ZERO

Question 1
Complete
Mark 1.00 out of 1.00

Flag question

Question text
This is a linear list in which insertions and deletions are made to form either end of the
structure.

Select one:
a. Priority
b. Random of queue
c. Dequeue
d. Circular queue

Question 2
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Value of first linked list index is _______________.

Select one:
a. -1
b. 1
c. 2
d. 0

Question 3
Complete
Mark 1.00 out of 1.00

Flag question

Question text

The term push and pop is related to _____________.

Select one:
a. array
b. trees
c. stacks
d. lists

Question 4
Complete
Mark 1.00 out of 1.00

Flag question

Question text

In the linked representation of the stack, __________ pointer behaves as the top pointer
variable of stack.

Select one:
a. Stop
b. Avail
c. Start
d. Begin

Question 5
Complete
Mark 1.00 out of 1.00

Flag question

Question text

The elements are removal from a stack in _________ order.

Select one:
a. Alternative
b. Reverse
c. Sequential
d. Hierarchical

Question 6
Complete
Mark 1.00 out of 1.00

Flag question

Question text

The retrieval of items in a stack is ___________ operation.

Select one:
a. push
b. access
c. pop
d. retrieval

Question 7
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Which of the following is a two-way list?

Select one:
a. Grounded header list
b. List traversed in two directions
c. Circular header list
d. Linked list with header and trailer nodes
Question 8
Complete
Mark 1.00 out of 1.00

Flag question

Question text

This refers to a linear collection of data items.

Select one:
a. Graph
b. Tree
c. Edge
d. List

Question 9
Complete
Mark 1.00 out of 1.00

Flag question

Question text

A linear list in which the pointer points only to the successive node.

Select one:
a. circular linked list
b. doubly linked list
c. none of these
d. singly linked list

Question 10
Complete
Mark 1.00 out of 1.00
Flag question

Question text

Which is the pointer associated with the availability list?

Select one:
a. REAR
b. TOP
c. FIRST
d. AVAIL

Question 1
Complete
Mark 1.00 out of 1.00

Flag question

Question text

This form of access is used to add/remove nodes from a stack.

Select one:
a. FIFO
b. None of these
c. Both of these
d. LIFO
Feedback

Your answer is correct.

Question 2
Complete
Mark 1.00 out of 1.00
Flag question

Question text

In a linked list, the ____________ contains the address of next element in the list.

Select one:
a. Start field
b. Info field
c. Link field
d. Next element field
Feedback

Your answer is correct.

Question 3
Complete
Mark 1.00 out of 1.00

Flag question

Question text

A linear list in which the last node points to the first node.

Select one:
a. none of these
b. singly linked list
c. circular linked list
d. doubly linked list
Feedback

Your answer is correct.


Question 4
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Stack follows the strategy of ________________.

Select one:
a. LRU
b. LIFO
c. FIFO
d. RANDOM
Feedback

Your answer is correct.

Question 5
Complete
Mark 1.00 out of 1.00

Flag question

Question text

The dummy header in linked list contains ____________________.

Select one:
a. last record of the actual data
b. pointer to the last record of the actual data
c. first record of the actual data
d. middle record of the actual data
Feedback
Your answer is correct.

Question 6
Complete
Mark 1.00 out of 1.00

Flag question

Question text

This is the term used to delete an element from the stack.

Select one:
a. Pump
b. Pop
c. Pull
d. Push
Feedback

Your answer is correct.

Question 7
Complete
Mark 1.00 out of 1.00

Flag question

Question text

This form of access is used to add and remove nodes from a queue.

Select one:
a. Both of these
b. None of these
c. LIFO, Last In First Out
d. FIFO, First In First Out
Feedback

Your answer is correct.

Question 8
Complete
Mark 1.00 out of 1.00

Flag question

Question text

The situation when in a linked list START=NULL is ____________________.

Select one:
a. Overflow
b. Houseful
c. Saturated
d. Underflow
Feedback

Your answer is correct.

Question 9
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Which is the pointer associated with the stack?

Select one:
a. REAR
b. FIRST
c. FRONT
d. TOP
Feedback

Your answer is correct.

Question 10
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Each node in singly linked list has _______ fields.

Select one:
a. 3
b. 4
c. 1
d. 2
Feedback

Your answer is correct.

Question 1
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Which is the pointer associated with the availability list?

Select one:
a. TOP
b. AVAIL
c. FIRST
d. REAR
Feedback

Your answer is correct.

Question 2
Complete
Mark 1.00 out of 1.00

Flag question

Question text

What happens when you push a new node onto a stack?

Select one:
a. The new node is placed at the front of the linked list
b. No changes happen
c. The new node is placed at the back of the linked list
d. The new node is placed at the middle of the linked list
Feedback

Your answer is correct.

Question 3
Complete
Mark 1.00 out of 1.00

Flag question

Question text
LINK is the pointer pointing to the ____________________.

Select one:
a. last node
b. predecessor node
c. successor node
d. head node
Feedback

Your answer is correct.

Question 4
Complete
Mark 1.00 out of 1.00

Flag question

Question text

This form of access is used to add/remove nodes from a stack.

Select one:
a. LIFO
b. None of these
c. Both of these
d. FIFO
Feedback

Your answer is correct.

Question 5
Complete
Mark 1.00 out of 1.00

Flag question
Question text

This is a linear list in which insertions and deletions are made to form either end of the
structure.

Select one:
a. Random of queue
b. Dequeue
c. Circular queue
d. Priority
Feedback

Your answer is correct.

Question 6
Complete
Mark 1.00 out of 1.00

Flag question

Question text

A linear list in which the pointer points only to the successive node.

Select one:
a. singly linked list
b. none of these
c. circular linked list
d. doubly linked list
Feedback

Your answer is correct.

Question 7
Complete
Mark 1.00 out of 1.00
Flag question

Question text

Each node in singly linked list has _______ fields.

Select one:
a. 3
b. 1
c. 4
d. 2
Feedback

Your answer is correct.

Question 8
Complete
Mark 1.00 out of 1.00

Flag question

Question text

The situation when in a linked list START=NULL is ____________________.

Select one:
a. Saturated
b. Overflow
c. Houseful
d. Underflow
Feedback

Your answer is correct.


Question 9
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Deletion operation is done using __________ in a queue.

Select one:
a. top
b. rear
c. list
d. front
Feedback

Your answer is correct.

Question 10
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Which of the following is an application of stack?

Select one:
a. finding factorial
b. all of these
c. infix to postfix
d. tower of Hanoi
Feedback
Your answer is correct.

Question 11
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Stack follows the strategy of ________________.

Select one:
a. FIFO
b. RANDOM
c. LIFO
d. LRU
Feedback

Your answer is correct.

Question 12
Complete
Mark 1.00 out of 1.00

Flag question

Question text

The term used to insert an element into stack.

Select one:
a. push
b. pop
c. pump
d. pull
Feedback

Your answer is correct.

Question 13
Complete
Mark 1.00 out of 1.00

Flag question

Question text

This is the term used to delete an element from the stack.

Select one:
a. Pop
b. Pump
c. Pull
d. Push
Feedback

Your answer is correct.

Question 14
Complete
Mark 1.00 out of 1.00

Flag question

Question text

A linear list in which the last node points to the first node.

Select one:
a. singly linked list
b. circular linked list
c. doubly linked list
d. none of these
Feedback

Your answer is correct.

Question 15
Complete
Mark 1.00 out of 1.00

Flag question

Question text

The term push and pop is related to _____________.

Select one:
a. lists
b. trees
c. stacks
d. array
Feedback

Your answer is correct.

Question 16
Complete
Mark 1.00 out of 1.00

Flag question

Question text

In linked lists, there are no NULL links in ______________

Select one:
a. linear doubly linked list
b. circular linked list
c. linked list
d. single linked list
Feedback

Your answer is correct.

Question 17
Complete
Mark 1.00 out of 1.00

Flag question

Question text

The retrieval of items in a stack is ___________ operation.

Select one:
a. access
b. push
c. pop
d. retrieval
Feedback

Your answer is correct.

Question 18
Complete
Mark 1.00 out of 1.00

Flag question

Question text
The dummy header in linked list contains ____________________.

Select one:
a. first record of the actual data
b. last record of the actual data
c. middle record of the actual data
d. pointer to the last record of the actual data
Feedback

Your answer is correct.

Question 19
Complete
Mark 1.00 out of 1.00

Flag question

Question text

What is a run list?

Select one:
a. number of elements having same value
b. small batches of records from a file
c. number of records
d. number of files in external storage
Feedback

Your answer is correct.

Question 20
Complete
Mark 1.00 out of 1.00

Flag question
Question text

What is a queue?

Select one:
a. LOFI
b. FIFO
c. FILO
d. LIFO
Feedback

Your answer is correct.

Question 21
Complete
Mark 1.00 out of 1.00

Flag question

Question text

In linked representation of stack, ___________ fields hold the elements of the stack.

Select one:
a. LINK
b. INFO
c. TOP
d. NULL
Feedback

Your answer is correct.

Question 22
Complete
Mark 1.00 out of 1.00
Flag question

Question text

Linked lists are best suited _____________________.

Select one:
a. for none of these situations
b. data structure
c. for relatively permanent collections of data
d. for the size of the structure and the data in the structure are constantly changing
Feedback

Your answer is correct.

Question 23
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Each node in a linked list must contain at least ___________________.

Select one:
a. Two fields
b. Four fields
c. Three fields
d. Five fields
Feedback

Your answer is correct.


Question 24
Complete
Mark 1.00 out of 1.00

Flag question

Question text

New nodes are added to the ________ of the queue.

Select one:
a. Back
b. Front and Back
c. Middle
d. Front
Feedback

Your answer is correct.

Question 25
Complete
Mark 1.00 out of 1.00

Flag question

Question text

In a linked list, the ____________ contains the address of next element in the list.

Select one:
a. Link field
b. Next element field
c. Info field
d. Start field
Feedback
Your answer is correct.

Question 26
Complete
Mark 1.00 out of 1.00

Flag question

Question text

The elements are removal from a stack in _________ order.

Select one:
a. Alternative
b. Sequential
c. Hierarchical
d. Reverse
Feedback

Your answer is correct.

Question 27
Complete
Mark 1.00 out of 1.00

Flag question

Question text

In linked representation of stack, the null pointer of the last node in the list signals
_____________________.

Select one:
a. Beginning of the stack
b. Bottom of the stack
c. Middle of the stack
d. In between some value
Feedback

Your answer is correct.

Question 28
Complete
Mark 1.00 out of 1.00

Flag question

Question text

A pointer variable which contains the location at the top element of the stack.

Select one:
a. End
b. Final
c. Top
d. Last
Feedback

Your answer is correct.

Question 29
Complete
Mark 1.00 out of 1.00

Flag question

Question text

The operation of processing each element in the list is known as ________________.

Select one:
a. merging
b. sorting
c. traversal
d. inserting
Feedback

Your answer is correct.

Question 30
Complete
Mark 1.00 out of 1.00

Flag question

Question text

This refers to a linear collection of data items.

Select one:
a. List
b. Edge
c. Graph
d. Tree
Feedback

Your answer is correct.

Question 31
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Which of the following names does not relate to stacks?


Select one:
a. LIFO lists
b. Piles
c. Push down lists
d. FIFO lists
Feedback

Your answer is correct.

Question 32
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Select one:
a. Maintenance
b. Garbage collection
c. Recycle bin
d. Memory management
Feedback

Your answer is correct.

Question 33
Complete
Mark 1.00 out of 1.00

Flag question

Question text
This indicates the end of the list.

Select one:
a. End pointer
b. Last pointer
c. Sentinel
d. Guard
Feedback

Your answer is correct.

Question 34
Complete
Mark 1.00 out of 1.00

Flag question

Question text

This is the insertion operation in the stack.

Select one:
a. push
b. top
c. insert
d. pop
Feedback

Your answer is correct.

Question 35
Complete
Mark 10.00 out of 10.00

Flag question
Question text

Fill in the following table, using Big-O notation to give the worst and average-case times for
each of the stack methods for a stack of size N.

OPERATION WORST-CASE TIME AVERAGE-CASE TIME


constructor O(1) O(1)
Answer Answer
empty O(1) O(1)
Answer Answer
size O(1) O(1)
Answer Answer
push O(N) O(1)
Answer Answer
pop O(1) O(1)
Answer Answer
peek O(1) O(1)
Answer Answer
PS: LETTER O PO YAN HINDI ZERO

Question 36
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Which is the pointer associated with the stack?

Select one:
a. TOP
b. REAR
c. FIRST
d. FRONT
Feedback

Your answer is correct.

Question 37
Complete
Mark 1.00 out of 1.00

Flag question

Question text

In the linked representation of the stack, __________ pointer behaves as the top pointer
variable of stack.

Select one:
a. Avail
b. Stop
c. Start
d. Begin
Feedback

Your answer is correct.

Question 38
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Which of the following is a two-way list?

Select one:
a. Linked list with header and trailer nodes
b. List traversed in two directions
c. Circular header list
d. Grounded header list
Feedback
Your answer is correct.

Question 39
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Value of first linked list index is _______________.

Select one:
a. -1
b. 1
c. 2
d. 0
Feedback

Your answer is correct.

Question 40
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Indexing the ________________ element in the list is not possible in linked lists.

Select one:
a. middle
b. first
c. anywhere in between
d. last
Feedback

Your answer is correct.

Question 41
Complete
Mark 1.00 out of 1.00

Flag question

Question text

This form of access is used to add and remove nodes from a queue.

Select one:
a. LIFO, Last In First Out
b. FIFO, First In First Out
c. Both of these
d. None of these
Feedback

Your answer is correct.

You might also like