This quiz works best with JavaScript enabled. Home > Class 12 > Class 12 Computer Science Chapter 1 Data Structures Using Python – Quiz 15 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 15 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. How do you access values in a dictionary using keys? A) Use dictionary name[key] to access values. B) Use dictionary name.key to find values. C) Access values by calling dictionary name[key](). D) Use dictionary name.get(key) to retrieve values. Show Answer Correct Answer: A) Use dictionary name[key] to access values. 2. How do you access elements in a two-dimensional list? A) Elements can be accessed using list[row index] only. B) Access elements with list[index] in a single dimension. C) Use list[row index][column index] to access elements. D) Use list[column index][row index] to access elements. Show Answer Correct Answer: C) Use list[row index][column index] to access elements. 3. Which method adds a new key-value pair? A) Student["major"] = "CIS". B) Student.add("major", "CIS"). C) Student.append("major"). D) Student.insert("major"). Show Answer Correct Answer: A) Student["major"] = "CIS". 4. Data is a collection of A) Facts. B) Raw material. C) Observation. D) All of the above. Show Answer Correct Answer: D) All of the above. 5. Consider the following statements in a Queue:enqueue(8); enqueue(2); enqueue(6); enqueue(4); dequeue();enqueue(5);What is the current size of the queue? A) 5. B) 6. C) 4. D) 3. Show Answer Correct Answer: C) 4. 6. If for an algorithm time complexity is given by O(n) then complexityof it is: A) Constant. B) Linear. C) Exponential. D) None of the mentioned. Show Answer Correct Answer: B) Linear. 7. Which of the following is an incorrect array declaration? A) Int [] arr = new int[5]. B) Int arr[] = new int[5]. C) Int arr[] = new int[5]. D) Int arr[] = int [5] new. Show Answer Correct Answer: D) Int arr[] = int [5] new. 8. What does the following piece of code do?public void func(Tree root) \{ func(root.left()); func(root.right()); System.out.println(root.data()); \} A) Preorder traversal. B) Inorder traversal. C) Postorder traversal. D) Level order traversal. Show Answer Correct Answer: C) Postorder traversal. 9. Suppose the numbers 7, 5, 1, 8, 3, 6, 0, 9, 4, 2 are inserted in that order into an initially empty binary search tree. The binary search tree uses the usual ordering on natural numbers. What is the in-order traversal sequence of the resultant tree? A) 7 5 1 0 3 2 4 6 8 9. B) 0 2 4 3 1 6 5 9 8 7. C) 0 1 2 3 4 5 6 7 8 9. D) 9 8 6 4 2 3 0 1 5 7. Show Answer Correct Answer: C) 0 1 2 3 4 5 6 7 8 9. 10. What is the significance of immutability in tuples? A) Immutability ensures data integrity, allows tuples to be hashable, and enables performance optimizations. B) Immutability reduces memory usage and increases data redundancy. C) Immutability allows for dynamic data changes and flexibility. D) Immutability prevents tuples from being used in sets or dictionaries. Show Answer Correct Answer: A) Immutability ensures data integrity, allows tuples to be hashable, and enables performance optimizations. 11. The process of Visiting each element in any Data structure is termed as ..... A) Traversing. B) Searching. C) Movement. D) Visiting. Show Answer Correct Answer: A) Traversing. 12. Which one of the below mentioned is linear data structure? A) Queue. B) Stack. C) Arrays. D) All of the above. Show Answer Correct Answer: D) All of the above. 13. Rotating a linked list by some places clockwise will take a time complexity of? A) O(n). B) O(1). C) O(log n). D) O(n log n). Show Answer Correct Answer: A) O(n). 14. (A):Array is collection of homogenous elements.(B):Array is an example for non linear data structure. A) Both A and B are true. B) A is false and B is true. C) A is true and B is false. D) Both A and B are false. Show Answer Correct Answer: C) A is true and B is false. 15. A graph is a collection of nodes, called ..... And line segments called arcs or ..... that connect pair of nodes. A) Vertices, edges. B) Edges, vertices. C) Vertices, paths. D) Graph node, edges. Show Answer Correct Answer: A) Vertices, edges. 16. In a list l=[1, 2, 3, 6], what would be the output of val =l.pop() A) 1. B) 2. C) 3. D) 6. Show Answer Correct Answer: D) 6. 17. State the meaning of "void" keyword: A) No statement. B) No function. C) No program. D) No value. Show Answer Correct Answer: D) No value. 18. If the insertion and deletion happens from both the ends then the queue is called a ..... Queue A) Deque. B) Header. C) Queue. D) Circular Queue. Show Answer Correct Answer: A) Deque. 19. Deletion from a stack is A) Del. B) Remove. C) Pop. D) Cancel. Show Answer Correct Answer: C) Pop. 20. Which data structure is used to check a palindrome? A) Linked List. B) Stack. C) Queue. D) Tree. Show Answer Correct Answer: B) Stack. 21. A collection of elements where each element is unique. A) HashSet. B) TreeSet. C) Set. D) LinkedHashSet. Show Answer Correct Answer: C) Set. 22. What is a non-primitive data structure? Provide an example. A) An example of a non-primitive data structure is a string. B) An example of a non-primitive data structure is a boolean. C) An example of a non-primitive data structure is a character. D) An example of a non-primitive data structure is an array. Show Answer Correct Answer: D) An example of a non-primitive data structure is an array. 23. The number of edges in a complete graph of n vertices is ..... A) N(n+1)/2. B) N(n-1)/2. C) N2 /2. D) N. Show Answer Correct Answer: B) N(n-1)/2. 24. Array data can be accessed using ..... A) Operator. B) Variable. C) Index. D) Pointer. Show Answer Correct Answer: C) Index. 25. Complete the code so that it only prints numbers from 1 to 5.number = 1 while ..... :print(number) number += 1 A) Number <= 5. B) Number >= 5. C) Number != 5. D) Number == 5. Show Answer Correct Answer: A) Number <= 5. ← 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