This quiz works best with JavaScript enabled. Home > Class 12 > Class 12 Computer Science Chapter 1 Data Structures Using Python – Quiz 2 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 2 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Main Operations in Stacks are Called A) Insertion and deletion. B) Push and Pop. C) Append and insertion. D) Append and pop. Show Answer Correct Answer: B) Push and Pop. 2. Three standards ways of traversing a binary tree T with root R ..... A) Prefix, infix, postfix. B) Pre-process, in-process, post-process. C) Pre-traversal, in-traversal, post-traversal. D) Pre-order, in-order, post-order. Show Answer Correct Answer: D) Pre-order, in-order, post-order. 3. Scores = [5, 7, 0, 10, 8, 3, 7, 3]Which value will be found using the following statement:print(scores[2]) A) 5. B) 7. C) 0. D) 10. Show Answer Correct Answer: C) 0. 4. What is the significance of the head and tail in a linked list? A) The head is used for sorting, while the tail manages memory allocation. B) The head points to the middle, and the tail connects to the previous node. C) The head stores the last element, and the tail holds the first element. D) The head is the starting point for traversal, and the tail indicates the end of the list. Show Answer Correct Answer: D) The head is the starting point for traversal, and the tail indicates the end of the list. 5. What is the purpose of the 'with' statement in Python? A) The 'with' statement is used to handle exceptions in Python. B) The 'with' statement simplifies exception handling by encapsulating common preparation and cleanup tasks. C) The 'with' statement is used to define a function in Python. D) The 'with' statement is used to create a new thread in Python. Show Answer Correct Answer: B) The 'with' statement simplifies exception handling by encapsulating common preparation and cleanup tasks. 6. What will be the output of this program?a = 2**3*5+(10-1)*9 A) 351. B) 121. C) 41. D) Error. Show Answer Correct Answer: B) 121. 7. Name and explain two common sorting algorithms. A) Radix Sort and Shell Sort. B) Insertion Sort and Merge Sort. C) Bubble Sort and Quick Sort. D) Heap Sort and Selection Sort. Show Answer Correct Answer: C) Bubble Sort and Quick Sort. 8. What is the output of the following code:for i in range(5):print(i)? A) 10. B) 5. C) 01234. D) -1. Show Answer Correct Answer: C) 01234. 9. What does the following code do? public Object function() \{ if(isEmpty()) return-999; else \{ Object high; high = q[front]; return high; \} \} A) Dequeue. B) Enqueue. C) Return the front element. D) Return the last element. Show Answer Correct Answer: C) Return the front element. 10. How do you create a tuple? A) You create a tuple by using square brackets, e.g., [1, 2, 3]. B) You create a tuple by using parentheses, e.g., (1, 2, 3). C) You create a tuple by using curly braces, e.g., \{1, 2, 3\}. D) You create a tuple by using angle brackets, e.g., <1, 2, 3>. Show Answer Correct Answer: B) You create a tuple by using parentheses, e.g., (1, 2, 3). 11. In the 'Counting Words in a sentence' activity using len(), what preprocessing step would be most important? A) Remove all punctuation marks. B) Count only alphabetic characters. C) Convert all letters to lowercase. D) Split the sentence into individual words. Show Answer Correct Answer: D) Split the sentence into individual words. 12. How can we initialize an array in C language? A) Int arr[2]=(10, 20);. B) Int arr(2)=\{10, 20\} ;. C) Int arr[2] = \{10, 20\};. D) Int arr(2) = (10, 20) ;. Show Answer Correct Answer: C) Int arr[2] = \{10, 20\};. 13. A map can contain duplicate keys. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: B) False. 14. In algorithm comment use by ..... brackets. A) Curley. B) Secure. C) None of the above. D) Both of the above. Show Answer Correct Answer: B) Secure. 15. How can you remove an item from a dictionary? A) Use 'del dict[key]' or 'dict.pop(key)'. B) Use 'dict.remove(key)'. C) Use 'dict.clear()'. D) Use 'dict.delete(key)'. Show Answer Correct Answer: A) Use 'del dict[key]' or 'dict.pop(key)'. 16. Queue uses ..... for adding and deleting elements. A) Top. B) Front. C) Rear. D) 2 and 3. Show Answer Correct Answer: D) 2 and 3. 17. Which of the following represents the Postorder Traversal of a Binary Tree? A) Left $\rightarrow$ Right $\rightarrow$ Root. B) Left $\rightarrow$ Root $\rightarrow$ Right. C) Right $\rightarrow$ Left $\rightarrow$ Root. D) Right $\rightarrow$ Root $\rightarrow$ Left. Show Answer Correct Answer: A) Left $\rightarrow$ Right $\rightarrow$ Root. 18. What is an AVL tree? A) A tree that has utmost two children. B) A tree that has utmost three children. C) A binary search tree and height-balanced tree. D) A binary search tree but an unbalanced tree. Show Answer Correct Answer: C) A binary search tree and height-balanced tree. 19. Which of the following operations is used to add an element to a queue? A) Enqueue. B) Dequeue. C) Peek. D) Pop. Show Answer Correct Answer: A) Enqueue. 20. How do you add a new key-value pair to a dictionary? A) Use 'dictionary.insert(key, value)' to add a key-value pair. B) Use 'dictionary[key] = value' to add a new key-value pair. C) Use 'add(key, value)' method to insert a new pair. D) Set 'dictionary.add(key, value)' to include a new entry. Show Answer Correct Answer: B) Use 'dictionary[key] = value' to add a new key-value pair. 21. Every stack has a variable ..... associated with it. A) TOP. B) BOT. C) POT. D) None of the above. Show Answer Correct Answer: A) TOP. 22. Arranging the books in order and removing from the topmost book is an example for ..... A) Linked List. B) Queue. C) Stack. D) Structure. Show Answer Correct Answer: C) Stack. 23. The format identifier '%i' is also used for ..... data type. A) Char. B) Int. C) Float. D) Double. Show Answer Correct Answer: B) Int. 24. Which of the following statements are not correct with respect to Singly Linked List(SLL) and Doubly Linked List(DLL)? A) Complexity of Insertion and Deletion at known position is O(n) in SLL and O(1) in DLL. B) SLL uses lesser memory per node than DLL. C) DLL has more searching power than SLL. D) Number of node fields in SLL is more than DLL. Show Answer Correct Answer: D) Number of node fields in SLL is more than DLL. 25. A container which can hold a fix number of items and these items should be of the same type. Most of the data structures make use of arrays to implement their algorithms. A) Element. B) Array. C) Index. D) None of the above. Show Answer Correct Answer: B) Array. ← PreviousNext →Related QuizzesClass 12 Computer Science Chapter 1 Data Structures Using Python Quiz 1Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 3Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 4Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 5Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 6Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 7Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 8Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 9Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 10Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 11 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books