This quiz works best with JavaScript enabled. Home > Cbse > Class 12 > Science > Computer Science > Class 12 Computer Science Chapter 1 Data Structures Using Python – Quiz 13 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 13 (38 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Linked list are not suitable data structure of which one of the following problems? A) Polynomial manipulation. B) Insertion sort. C) Radix sort. D) Binary search. Show Answer Correct Answer: D) Binary search. 2. Which statement maps the value "Pre-final" to the identifier named PF? A) ThisMap.put("PF", "Pre-final");. B) ThisMap.add("PF", "Pre-final");. C) ThisMap.put("Pre-final", "PF");. D) ThisMap.add("Pre-final", "PF");. Show Answer Correct Answer: A) ThisMap.put("PF", "Pre-final");. 3. 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) Heap. B) Array List. C) Queue. D) Priority Queue. Show Answer Correct Answer: A) Heap. 4. 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. 5. Which value is assigned/set at front and rear ends during the Initialization of a Queue? A) 0. B) -1. C) Infinity. D) 1. Show Answer Correct Answer: B) -1. 6. Minimum number of fields in each node of a doubly linked list is ..... A) 5. B) 4. C) 3. D) 2. Show Answer Correct Answer: C) 3. 7. Eight Bits make up a A) Byte. B) Megabyte. C) Kilobyte. D) None. Show Answer Correct Answer: A) Byte. 8. 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(log2 n). B) O(n). C) O(logn). D) O(1). Show Answer Correct Answer: D) O(1). 9. 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.update("Diana"). B) Friends.append("Diana"). C) Friends.insert("Diana"). D) Friends.add("Diana"). Show Answer Correct Answer: B) Friends.append("Diana"). 10. Which method adds a single item to a set? A) Insert(). B) Append(). C) Add(). D) Push(). Show Answer Correct Answer: C) Add(). 11. 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) 3. B) 5. C) 2. D) 4. Show Answer Correct Answer: A) 3. 12. In the 'Reversing a String' activity that uses 'Recursive function', what is the base case most likely to be? A) When the string contains only vowels. B) When the string is empty or has one character. C) When the string length equals 10. D) When the string contains spaces. Show Answer Correct Answer: B) When the string is empty or has one character. 13. The number of edges from the node to the deepest leaf is called ..... of the tree. A) Width. B) Height. C) Depth. D) Length. Show Answer Correct Answer: B) Height. 14. 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. 15. 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. 16. Which of the following is the advantage of the array data structure? A) Elements of mixed data types can be stored. B) Elements of an array cannot be sorted. C) Easier to access the elements in an array. D) Index of the first element starts from 1. Show Answer Correct Answer: C) Easier to access the elements in an array. 17. 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) DCAB. B) ABDC. C) DCBA. D) ABCD. Show Answer Correct Answer: C) DCBA. 18. 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. 19. Which method adds a value to the end of a list? A) Push(). B) Extendlast(). C) Append(). D) Add(). Show Answer Correct Answer: C) Append(). 20. What is the starting index of array? A) -1. B) 1. C) 0. D) None of the above. Show Answer Correct Answer: C) 0. 21. A tree sort is also known as ..... sort. A) Shell. B) Selection. C) Quick. D) Heap. Show Answer Correct Answer: D) Heap. 22. The term push and pop is related to A) List. B) Queue. C) Array. D) Stack. Show Answer Correct Answer: D) Stack. 23. Stack performs ..... operation A) PUSH. B) POP. C) Both of the above. D) None of the above. Show Answer Correct Answer: C) Both of the above. 24. Which data structure is used for implementing recursion? A) Stack. B) Queue. C) Array. D) List. Show Answer Correct Answer: A) Stack. 25. What is the speciality about the inorder traversal of a binary search tree? A) It traverses in a non increasing order. B) It traverses in an increasing order. C) It traverses in a random fashion. D) It traverses based on priority of the node. Show Answer Correct Answer: B) It traverses in an increasing order. 26. What are the two main classifications of data structures? A) Ordered and Unordered. B) Simple and Complex. C) Static and Dynamic. D) Linear and Non-linear. Show Answer Correct Answer: D) Linear and Non-linear. 27. How do you check if a list is empty in Python? A) If not list:. B) If list == []:. C) If len(list) == 0:. D) All of the above. Show Answer Correct Answer: D) All of the above. 28. Which of the following is the correct index range for a zero-based indexed array of size 10 in most programming languages (like C, Java, Python)? A) 1 to 10. B) 0 to 9. C) 0 to 10. D) 1 to 9. Show Answer Correct Answer: B) 0 to 9. 29. The algorithm is completed when the statement ..... is encountered. A) Return. B) Finish. C) EXIT. D) None of the above. Show Answer Correct Answer: C) EXIT. 30. Which of the following sorting algorithms can be used to sort a random linked list with minimum time complexity? A) Insertion Sort. B) Heap Sort. C) Quick Sort. D) Merge Sort. Show Answer Correct Answer: D) Merge Sort. 31. What is the disadvantage of array data structure? A) Elements of an array can be accessed in constant time. B) The amount of memory to be allocated should be known beforehand. C) Elements are stored in contiguous memory blocks. D) Multiple other data structures can be implemented using arrays. Show Answer Correct Answer: B) The amount of memory to be allocated should be known beforehand. 32. Which of the following data structures can be used to implement queues? A) Stack. B) Arrays. C) LinkedList. D) All of the Above. Show Answer Correct Answer: D) All of the Above. 33. Int is ..... data type. A) User defined. B) Derived. C) Primary. D) All of above. Show Answer Correct Answer: C) Primary. 34. How many children does a binary tree have? A) 0 or 1. B) 0 or 1 or 2. C) Any number of children. D) 2. Show Answer Correct Answer: B) 0 or 1 or 2. 35. What method in Python is used to remove an element from a set? A) Delete(). B) Remove(). C) Discard(). D) Pop(). Show Answer Correct Answer: B) Remove(). 36. What is the output of following function for start pointing to first node of following linked list? 1$\rightarrow$2$\rightarrow$3$\rightarrow$4$\rightarrow$5$\rightarrow$6 void fun(struct node* start) \{ if(start == NULL) return; printf("%d ", start$\rightarrow$data); if(start$\rightarrow$next != NULL ) fun(start$\rightarrow$next$\rightarrow$next); printf("%d ", start$\rightarrow$data); \} A) 1 2 3 5. B) 1 3 5 1 3 5. C) 1 3 5 5 3 1. D) 1 4 6 6 4 1. Show Answer Correct Answer: C) 1 3 5 5 3 1. 37. What does the .pop(key) function do in Python Dictionaries? A) Prints out all the keys within the Dictionary. B) Prints out all the values within the Dictionary. C) Removes the requested key with its value from the Dictionary. D) Returns the number of items in the Dictionary. Show Answer Correct Answer: C) Removes the requested key with its value from the Dictionary. 38. How will you find the minimum element in a binary search tree? A) While(root.right() != null) { root = root.right(); } System.out.println(root.data());. B) While(root != null) { root = root.right(); } System.out.println(root.data());. C) While(root != null) { root = root.left(); } System.out.println(root.data());. D) While(root.left() != null) { root = root.left(); } System.out.println(root.data());. Show Answer Correct Answer: D) While(root.left() != null) { root = root.left(); } System.out.println(root.data());. ← PreviousRelated QuizzesScience QuizzesClass 12 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 8 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books