This quiz works best with JavaScript enabled. Home > Class 12 > Class 12 Computer Science Chapter 1 Data Structures Using Python – Quiz 31 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 31 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. The data structure required for Breadth First Traversal on a graph is A) Array. B) Stack. C) Tree. D) Queue. Show Answer Correct Answer: D) Queue. 2. Which of the following data structures is immutable? A) Tuple. B) List. C) Dictionary. D) 2d List. Show Answer Correct Answer: A) Tuple. 3. Consider an implementation of unsorted singly linked list. Suppose it has its representation with a head pointer only. Given the representation, which of the following operation can be implemented in O(1) time?i) Insertion at the front of the linked list ii) Insertion at the end of the linked list iii) Deletion of the front node of the linked list iv) Deletion of the last node of the linked list A) I and II. B) I and III. C) I, II and III. D) I, II and IV. Show Answer Correct Answer: B) I and III. 4. Linked list are not suitable data structure of which one of the following problems? A) Insertion sort. B) Binary search. C) Polynomial manipulation. D) Radix sort. Show Answer Correct Answer: B) Binary search. 5. Which statement maps the value "Pre-final" to the identifier named PF? A) ThisMap.put("PF", "Pre-final");. B) ThisMap.put("Pre-final", "PF");. C) ThisMap.add("Pre-final", "PF");. D) ThisMap.add("PF", "Pre-final");. Show Answer Correct Answer: A) ThisMap.put("PF", "Pre-final");. 6. It is a complete binary tree where the value of each parent node is either higher or lower than the value of its child nodes. A) Priority Queue. B) Heap. C) Array List. D) Queue. Show Answer Correct Answer: B) Heap. 7. How does merge sort work? A) Merge sort sorts an array by randomly shuffling its elements. B) Merge sort is a linear algorithm that processes elements one by one. C) Merge sort is a divide-and-conquer algorithm that sorts an array by recursively splitting it into halves and merging the sorted halves. D) Merge sort requires the entire array to be sorted before it can begin. Show Answer Correct Answer: C) Merge sort is a divide-and-conquer algorithm that sorts an array by recursively splitting it into halves and merging the sorted halves. 8. Which value is assigned/set at front and rear ends during the Initialization of a Queue? A) 0. B) 1. C) -1. D) Infinity. Show Answer Correct Answer: C) -1. 9. Minimum number of fields in each node of a doubly linked list is ..... A) 2. B) 3. C) 4. D) 5. Show Answer Correct Answer: B) 3. 10. Eight Bits make up a A) Byte. B) Megabyte. C) Kilobyte. D) None. Show Answer Correct Answer: A) Byte. 11. Let P be a singly linked list. Let Q be the pointer to an intermediate node x in the list. What is the worst-case time complexity of the best known algorithm to delete the node x from the list? A) O(n). B) O(log2 n). C) O(logn). D) O(1). Show Answer Correct Answer: D) O(1). 12. Which of the following would correctly add an item to a list in Python?Criterion 2:Apply reasoning to solve real-world problems in various contexts A) Friends.add("Diana"). B) Friends.append("Diana"). C) Friends.insert("Diana"). D) Friends.update("Diana"). Show Answer Correct Answer: B) Friends.append("Diana"). 13. Which method adds a single item to a set? A) Add(). B) Append(). C) Push(). D) Insert(). Show Answer Correct Answer: A) Add(). 14. If the front pointer is at index 2 and the rear pointer is at index 4 in a circular queue of size 6, what is the length of the queue? A) 2. B) 3. C) 4. D) 5. Show Answer Correct Answer: B) 3. 15. In the 'Reversing a String' activity that uses 'Recursive function', what is the base case most likely to be? A) When the string is empty or has one character. B) When the string length equals 10. C) When the string contains only vowels. D) When the string contains spaces. Show Answer Correct Answer: A) When the string is empty or has one character. 16. The number of edges from the node to the deepest leaf is called ..... of the tree. A) Height. B) Depth. C) Length. D) Width. Show Answer Correct Answer: A) Height. 17. Explain the concept of slicing in Python with respect to lists and strings. A) Slicing in Python means combining two lists or strings into one. B) Slicing in Python refers to dividing a list or string into equal parts. C) Slicing in Python allows you to extract a portion of a list or string by specifying a start and end index, and an optional step size. D) Slicing in Python involves removing elements from a list or string. Show Answer Correct Answer: C) Slicing in Python allows you to extract a portion of a list or string by specifying a start and end index, and an optional step size. 18. What is the difference between a set and a list in Python? A) A set is ordered and allows duplicate elements, while a list is unordered and does not allow duplicates. B) A set is unordered and does not allow duplicate elements, while a list is ordered and allows duplicates. C) Both sets and lists are ordered collections that allow duplicates. D) A set is a mutable collection, while a list is immutable. Show Answer Correct Answer: B) A set is unordered and does not allow duplicate elements, while a list is ordered and allows duplicates. 19. What is the difference between a shallow copy and a deep copy in Python? A) A shallow copy creates a new object but inserts references into it to the objects found in the original. B) A deep copy creates a new object and recursively adds copies of nested objects found in the original. C) Both shallow and deep copies create new objects with the same references. D) A shallow copy is faster than a deep copy because it does not copy nested objects. Show Answer Correct Answer: A) A shallow copy creates a new object but inserts references into it to the objects found in the original. 20. Which of the following is the advantage of the array data structure? A) Elements of mixed data types can be stored. B) Easier to access the elements in an array. C) Index of the first element starts from 1. D) Elements of an array cannot be sorted. Show Answer Correct Answer: B) Easier to access the elements in an array. 21. If the elements "A" , "B" , "C" and "D" are placed in a stack and are deleted one at a time, in what order will they be removed? A) ABCD. B) DCBA. C) DCAB. D) ABDC. Show Answer Correct Answer: B) DCBA. 22. When a function is designed to 'take input (parameters) and return output', what programming concept is being implemented? A) Variable declaration. B) Input-output processing. C) Memory allocation. D) Data encapsulation. Show Answer Correct Answer: B) Input-output processing. 23. Which method adds a value to the end of a list? A) Append(). B) Add(). C) Push(). D) Extendlast(). Show Answer Correct Answer: A) Append(). 24. What is the starting index of array? A) -1. B) 1. C) 0. D) None of the above. Show Answer Correct Answer: C) 0. 25. A tree sort is also known as ..... sort. A) Quick. B) Heap. C) Shell. D) Selection. Show Answer Correct Answer: B) Heap. ← PreviousNext →Related QuizzesClass 12 Computer Science Chapter 1 Data Structures Using Python Quiz 1Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 2Class 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 10 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books