

MCQOPTIONS
Saved Bookmarks
This section includes 114 Mcqs, each offering curated multiple-choice questions to sharpen your Python knowledge and support exam preparation. Choose a topic below to get started.
101. |
Consider a linked list of n elements. What is the time taken to insert an element after element pointed by same pointer ? |
A. | O(n) |
B. | O(log n) |
C. | O(n-1) |
D. | O(1) |
Answer» E. | |
102. |
A linear list in which each node has pointers to point to the predecessor and successors nodes is called as |
A. | Singly Linked List |
B. | Circular Linked List |
C. | Doubly Linked List |
D. | Linear Linked List |
Answer» D. Linear Linked List | |
103. |
The advantage of …………….. is that they solve the problem if sequential storage representation. But disadvantage in that is they are sequential lists. |
A. | Lists |
B. | Linked Lists |
C. | Trees |
D. | Queues |
Answer» C. Trees | |
104. |
There is an extra element at the head of the list called a ………. |
A. | Antinel |
B. | Sentinel |
C. | List header |
D. | List head |
Answer» C. List header | |
105. |
In doubly linked lists |
A. | a pointer is maintained to store both next and previous nodes. |
B. | two pointers are maintained to store next and previous nodes. |
C. | a pointer to self is maintained for each node. |
D. | none of the above. |
Answer» C. a pointer to self is maintained for each node. | |
106. |
Each node in a linked list has two pairs of ………….. and ………………. |
A. | Link field and information field |
B. | Link field and avail field |
C. | Avail field and information field |
D. | Address field and link field |
Answer» B. Link field and avail field | |
107. |
The disadvantage in using a circular linked list is ……………………. |
A. | It is possible to get into infinite loop |
B. | Last node points to first node. |
C. | Time consuming |
D. | Requires more memory space |
Answer» B. Last node points to first node. | |
108. |
node.next -> node.next.next; will make |
A. | node.next inaccessible |
B. | node.next.next inaccessible |
C. | this node inaccessible |
D. | none of the above |
Answer» B. node.next.next inaccessible | |
109. |
………… is very useful in situation when data have to stored and then retrieved in reverse order. |
A. | Stack |
B. | Queue |
C. | List |
D. | Link list |
Answer» B. Queue | |
110. |
A circular linked list can be used for |
A. | Stack |
B. | Queue |
C. | Both Stack & Queue |
D. | Neither Stack or Queue |
Answer» D. Neither Stack or Queue | |
111. |
SUPPOSE_LIST1_IS_[2,_33,_222,_14,_25],_WHAT_IS_LIST1[:-1]_??$ |
A. | [2, 33, 222, 14]. |
B. | Error |
C. | 25 |
D. | [25, 14, 222, 33, 2]. |
Answer» B. Error | |
112. |
To shuffle the list(say list1) what function do we use ? |
A. | list1.shuffle() |
B. | shuffle(list1) |
C. | random.shuffle(list1) |
D. | random.shuffleList(list1) |
Answer» D. random.shuffleList(list1) | |
113. |
Suppose listExample is [‘h’,’e’,’l’,’l’,’o’], what is len(listExample)?$ |
A. | 5 |
B. | 4 |
C. | None |
D. | Error |
Answer» B. 4 | |
114. |
What is the output when we execute list(“hello”)?$ |
A. | [‘h’, ‘e’, ‘l’, ‘l’, ‘o’]. |
B. | [‘hello’]. |
C. | [‘llo’]. |
D. | [‘olleh’]. |
Answer» B. [‚Äö√Ñ√∂‚àö√ë‚àö‚â§hello‚Äö√Ñ√∂‚àö√ë‚àö¬•]. | |