This quiz works best with JavaScript enabled. Home > Class 12 > Class 12 Computer Science Chapter 1 Data Structures Using Python – Quiz 28 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 28 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Under which situation is the Enum data structure used? A) Different data types. B) Storing images. C) Fix no. of values. D) Date related data. Show Answer Correct Answer: C) Fix no. of values. 2. What is the height of a binary tree with only one node (the root)? A) 0. B) 1. C) 2. D) -1. Show Answer Correct Answer: A) 0. 3. Which of the following is/are the levels of implementation of data structure A) Abstract level. B) Application level. C) Implementation level. D) All of the above. Show Answer Correct Answer: D) All of the above. 4. How do you access the second element of a tuple? A) T[1]. B) T[2]. C) T(second). D) T[-0]. Show Answer Correct Answer: A) T[1]. 5. What is the purpose of the quicksort algorithm? A) To merge sorted lists into a single array. B) To sort elements efficiently using a divide-and-conquer approach. C) To analyze data using a linear search method. D) To find the maximum element in a dataset. Show Answer Correct Answer: B) To sort elements efficiently using a divide-and-conquer approach. 6. Based on the following statements, which are the leaf nodes?ArrayList minHeap = new ArrayList<>();Collections.addAll(minHeap, 2, 4, 5, 7, 8); A) 5, 7, and 8. B) 4, 5, and 7. C) 2, 4, and 5. D) 7 and 8. Show Answer Correct Answer: A) 5, 7, and 8. 7. The data structure used to check whether an expression contains a balanced parenthesis is? A) Queue. B) Tree. C) Stack. D) Array. Show Answer Correct Answer: C) Stack. 8. A binary search tree whose left subtree and right subtree differ in height by at most 1 unit is called A) AVL tree. B) Red-black tree. C) Lemma tree. D) None of the above. Show Answer Correct Answer: A) AVL tree. 9. Data structure can be of two types namely ..... A) Simple and Nested. B) Simple and Compound. C) Sequential and random. D) All of the above. Show Answer Correct Answer: B) Simple and Compound. 10. What is the main difference between a tuple and a list? A) The main difference is that tuples are immutable and lists are mutable. B) Tuples are created using square brackets, while lists use parentheses. C) Lists can contain only numbers, while tuples can contain any data type. D) Tuples can be resized, while lists cannot. Show Answer Correct Answer: A) The main difference is that tuples are immutable and lists are mutable. 11. Give an example of a primitive data structure in Python. A) String. B) List. C) Int. D) Float. Show Answer Correct Answer: C) Int. 12. Other name for directed graph is ..... A) Direct graph. B) Digraph. C) Dir-graph. D) Dgraph. Show Answer Correct Answer: B) Digraph. 13. How do you create a set? A) Use list() or []. B) Define a dictionary with \{\}. C) Use set() or \{\}. D) Create a tuple with (). Show Answer Correct Answer: C) Use set() or \{\}. 14. For the activity 'Counting vowels in a sentence' that uses 'for loop within the function', what is the most efficient approach? A) Use nested loops to compare each character with each vowel. B) Sort the sentence alphabetically first. C) Convert the sentence to uppercase first, then check each character. D) Check each character once and count matches. Show Answer Correct Answer: C) Convert the sentence to uppercase first, then check each character. 15. Example of non linear data structure A) Array. B) Tree. C) Queue. D) Stack. Show Answer Correct Answer: B) Tree. 16. Which of the following points is/are true about Linked List data structure when it is compared with array A) Arrays have better cache locality that can make them better in terms of performance. B) It is easy to insert and delete elements in Linked List. C) The size of array has to be pre-decided, linked lists can change their size any time. D) Random access is not allowed in a typical implementation of Linked Lists. E) All the Above. Show Answer Correct Answer: E) All the Above. 17. It is a type of queue where elements are processed based on their order either natural or custom. A) Priority Queue. B) Array List. C) Min Heap. D) Max Heap. Show Answer Correct Answer: A) Priority Queue. 18. If the elements P, W, S, D are placed in a stack and are deleted one at a time, what is the order of removal? A) PWSD. B) PDWS. C) DWSP. D) DSWP. Show Answer Correct Answer: D) DSWP. 19. What does the return statement do in a Python function?Criterion 2:Apply reasoning to solve real-world problems in various contexts A) It sends a result back to the function. B) It loops through the function. C) 'return' terminates the function and sends a result back. D) It skips the function. Show Answer Correct Answer: C) 'return' terminates the function and sends a result back. 20. The maximum number of nodes in a binary tree of depth 5 is A) 31. B) 16. C) 32. D) 15. Show Answer Correct Answer: A) 31. 21. Push() and pop() functions are found in ..... A) Stacks. B) Trees. C) Queues. D) Lists. Show Answer Correct Answer: A) Stacks. 22. Which among the following sorting algorithm is the most optimal one to sort a random linked list? A) Merge sort. B) Insertion sort. C) Quick sort. D) Heap sort. Show Answer Correct Answer: A) Merge sort. 23. What is stack? A) Data structure where insertion and deletion takes place AT TOP. B) Data structure where insertion and deletion takes place from front. C) Data structure where insertion and deletion takes place from rear(last). D) Data structure where insertion takes place at front and deletion takes place AT rear(last). Show Answer Correct Answer: A) Data structure where insertion and deletion takes place AT TOP. 24. To represent hierarchical relationship between elements, which data structure is suitable? A) Dequeue. B) Priority. C) Tree. D) Graph. Show Answer Correct Answer: C) Tree. 25. Finding the location of a given item in a collection of items is called ..... A) Discovering. B) Mining. C) Finding. D) Searching. Show Answer Correct Answer: D) Searching. ← 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