This quiz works best with JavaScript enabled. Home > Class 12 > Class 12 Computer Science Chapter 1 Data Structures Using Python – Quiz 1 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 1 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Consider the usual algorithm for determining whether a sequence of parentheses is balanced.Suppose that you run the algorithm on a sequence that contains 2 left parentheses and 3 right parentheses (in some order).The maximum number of parentheses that appear on the stack AT ANY ONE TIME during the computation? A) 6. B) 3. C) 4. D) 2. Show Answer Correct Answer: D) 2. 2. Array can be classified in how many types? A) 1. B) 2. C) 3. D) More than 4. Show Answer Correct Answer: B) 2. 3. ..... 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. Show Answer Correct Answer: A) Stack. 4. What is the time complexity of deleting from the rear end of the dequeue implemented with a singly linked list? A) O(nlogn). B) O(logn). C) O(n). D) O(n$^{2}$). Show Answer Correct Answer: C) O(n). 5. What is the advantage of using a priority queue over a regular queue? A) Priority queues are faster for all operations. B) It allows elements to be processed based on their priority rather than their order of arrival. C) Priority queues are more memory-efficient. D) Priority queues do not require sorting. Show Answer Correct Answer: B) It allows elements to be processed based on their priority rather than their order of arrival. 6. What will this code do? colors[1] = "yellow" A) Change the second item in the list. B) Remove the first item. C) Add a new value to the front. D) Do nothing. Show Answer Correct Answer: A) Change the second item in the list. 7. How do you access elements in a tuple? A) Use indexing with square brackets, e.g., tuple name[index]. B) Elements can only be accessed by iterating through the tuple. C) Use curly braces to access elements, e.g., tuple name\{index\}. D) Access elements using parentheses, e.g., tuple name(index). Show Answer Correct Answer: A) Use indexing with square brackets, e.g., tuple name[index]. 8. What is the difference between a list and a dictionary? A) A list is an ordered collection of items; a dictionary is a collection of key-value pairs. B) A list can only contain numbers; a dictionary can contain any data type. C) A list is unordered; a dictionary is an ordered collection of items. D) A list is a collection of key-value pairs; a dictionary is an ordered collection of items. Show Answer Correct Answer: A) A list is an ordered collection of items; a dictionary is a collection of key-value pairs. 9. How do you check if a variable is equal to a specific value using if-else? A) If (variable == value) \{ // code for true \} else \{ // code for false \}. B) If (variable = value) \{ // code for true \} else \{ // code for false \}. C) If (value == variable) \{ // code for true \} else \{ // code for false \}. D) If (variable != value) \{ // code for true \} else \{ // code for false \}. Show Answer Correct Answer: A) If (variable == value) \{ // code for true \} else \{ // code for false \}. 10. For the 'Calculating Percent Markup' activity, what validation should the function include? A) Confirm inputs are less than 100. B) Verify inputs are whole numbers only. C) Check that inputs are positive numbers. D) Ensure inputs are strings. Show Answer Correct Answer: C) Check that inputs are positive numbers. 11. How do you append an element to a list in Python? A) Combine lists with my list += [element]. B) Use the append() method:my list.append(element). C) Use the add() function:my list.add(element). D) Insert the element with my list.insert(element). Show Answer Correct Answer: B) Use the append() method:my list.append(element). 12. B-tree and AVL tree have the same worst case time complexity for insertion and deletion. A) A) True. B) B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) A) True. 13. What is a two-dimensional array visualized as? A) A graph. B) A cube. C) A table. D) A line. Show Answer Correct Answer: C) A table. 14. What is the time complexity to insert an element to the front of a LinkedList(head pointer given)? A) O(n). B) O(1). C) O(log n). D) O(n log n). Show Answer Correct Answer: B) O(1). 15. Root has more left descendants than the right descendants or vice versa. A) Balanced Tree. B) Perfect Tree. C) Right Tree. D) Unbalanced Tree. Show Answer Correct Answer: D) Unbalanced Tree. 16. Which data structure is suitable for implementing a breadth-first search algorithm? A) Stack. B) Queue. C) Heap. D) Linked list. Show Answer Correct Answer: B) Queue. 17. Which of the following is not an advantage of trees? A) Hierarchical structure. B) Faster search. C) Router algorithms. D) Undo/Redo operations in a notepad. Show Answer Correct Answer: D) Undo/Redo operations in a notepad. 18. What is the purpose of the del statement in Python? A) Deletes items from a List based on index position. B) Deletes items from a dictionary based on value. C) Deletes items from a list based on element value. D) Deletes any items from a tuple. Show Answer Correct Answer: A) Deletes items from a List based on index position. 19. Data word is? A) Singlular. B) Palural. C) None of the above. D) Both. Show Answer Correct Answer: B) Palural. 20. In a graph if E=(u, v) means ..... A) U is adjacent to v but v is not adjacent to u. B) E begins at u and ends at v. C) U is processor and v is successor. D) Both b and c. Show Answer Correct Answer: D) Both b and c. 21. Pushing an element into stack already having five elements and stack size of 5, then stack becomes A) Overflow. B) Crash. C) Underflow. D) User flow. Show Answer Correct Answer: A) Overflow. 22. Which of the following is the disadvantage of the array? A) Index of the first element in an array can be negative. B) Stack and Queue data structures can be implemented through an array. C) Wastage of memory if the elements inserted in an array are lesser than the allocated size. D) Elements can be accessed sequentially. Show Answer Correct Answer: C) Wastage of memory if the elements inserted in an array are lesser than the allocated size. 23. Which among the below specified condition is applicable if the Queue is non-empty? A) Rear > front. B) Rear < front. C) Rear = front. D) Unpredictable. Show Answer Correct Answer: A) Rear > front. 24. What are the main differences between a list and a set in Python? A) Sets allow duplicates and maintain order; lists do not allow duplicates and are unordered. B) Lists do not allow duplicates and are unordered; sets allow duplicates and maintain order. C) Lists are unordered and allow duplicates; sets maintain order and allow duplicates. D) Lists allow duplicates and maintain order; sets do not allow duplicates and are unordered. Show Answer Correct Answer: D) Lists allow duplicates and maintain order; sets do not allow duplicates and are unordered. 25. What is a tuple? A) An ordered, unchangeable collection. B) An unordered, changeable collection. C) A key-value store. D) A unique-value collection. Show Answer Correct Answer: A) An ordered, unchangeable collection. Next →Related QuizzesClass 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 10Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 11 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books