This quiz works best with JavaScript enabled. Home > Class 12 > Class 12 Computer Science Chapter 1 Data Structures Using Python – Quiz 4 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 4 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Collection of dissimilar type of data item is called A) Array. B) Structure. C) A & B Both. D) None of these. Show Answer Correct Answer: B) Structure. 2. Input/output function prototypes and macros are defined in which header file? A) Conio.h. B) Stdlib.h. C) Stdio.h. D) Dos.h. Show Answer Correct Answer: C) Stdio.h. 3. Which of the following is not a correct variable type? A) Int. B) Real. C) Float. D) Char. Show Answer Correct Answer: B) Real. 4. How would you access an item in a three-dimensional array? A) Using one index. B) Using two indexes. C) Using four indexes. D) Using three indexes. Show Answer Correct Answer: D) Using three indexes. 5. It is a method of solving problems that involves breaking a problem down into smaller and smaller sub problems until you get to a small enough problem that it can be solved trivially. A) Recursion. B) Iteration. C) Looping. D) None of the above. Show Answer Correct Answer: A) Recursion. 6. What is the only function all C programs must contain? A) Start(). B) System(). C) Main(). D) Program(). Show Answer Correct Answer: C) Main(). 7. How do you handle exceptions in Python using try and except blocks? A) Use try to wrap the code that may raise an exception, and use except to define how to handle the exception. B) Ignore exceptions and let the program crash. C) Wrap all code in a single except block regardless of the exception type. D) Use only try without except to handle exceptions. Show Answer Correct Answer: A) Use try to wrap the code that may raise an exception, and use except to define how to handle the exception. 8. The complexity of Binary search algorithm is A) O(n). B) O(n log n). C) O(n2). D) O(log n). Show Answer Correct Answer: D) O(log n). 9. Stack is also called as A) Last in first out. B) First in last out. C) Last in last out. D) First in first out. Show Answer Correct Answer: A) Last in first out. 10. A linear list of elements in which deletion can be done from one end (front) and insertion can take place only at the other end (rear) is known as ..... A) Queue. B) Stack. C) Tree. D) Linked list. Show Answer Correct Answer: A) Queue. 11. Which of these in NOT a linear data structure? A) Tree. B) Stack. C) Array. D) Queue. Show Answer Correct Answer: A) Tree. 12. What is the method to get all keys from a dictionary? A) Use 'dict.keys()' to get all keys from a dictionary. B) Use 'dict.all keys()' to fetch all keys from a dictionary. C) Call 'list.keys()' to access dictionary keys. D) Use 'dict.get()' to retrieve keys from a dictionary. Show Answer Correct Answer: A) Use 'dict.keys()' to get all keys from a dictionary. 13. What method in Python is used to add an element to a set? A) Add(). B) Modify(). C) Update(). D) Insert(). Show Answer Correct Answer: A) Add(). 14. How do you iterate over the items in a tuple? A) Access items in a tuple using their index only. B) Use a for loop to iterate over the items in a tuple. C) Convert the tuple to a list and then iterate over it. D) Use a while loop to iterate over the items in a tuple. Show Answer Correct Answer: B) Use a for loop to iterate over the items in a tuple. 15. Number of possible ordered trees with 3 nodes A, B, C is A) Op 1:16. B) Op 2:12. C) Op 3:13. D) Op 4:14. Show Answer Correct Answer: B) Op 2:12. 16. ..... technique is used by solving optimization problems A) Divide and conquer. B) Greedy method. C) Dynamic programming. D) Both b and c. Show Answer Correct Answer: D) Both b and c. 17. Root A) Data structure similar to a graph, with no loops. B) An object in a graph also known as a vertex. C) A join of relationship between nodes-also know as an arc. D) The starting node in a rooted tree structure from which all other nodes branch off./. Show Answer Correct Answer: D) The starting node in a rooted tree structure from which all other nodes branch off./. 18. Which iteration method is commonly used with arrays? A) ELSE. B) WHILE. C) IF. D) FOR. Show Answer Correct Answer: D) FOR. 19. How can you handle multiple exceptions in a single try block? A) Handle exceptions in a separate function. B) Use multiple except clauses or a tuple of exceptions in a single except clause. C) Ignore exceptions entirely. D) Use a single except clause for all exceptions. Show Answer Correct Answer: B) Use multiple except clauses or a tuple of exceptions in a single except clause. 20. ..... data structures are those whose sizes and structures associated memory locations are fixed at compile time. A) Linear. B) Homogeneous. C) Static. D) Dynamic. Show Answer Correct Answer: C) Static. 21. Is the syntax for the following C statement correct?:scanf("%d", input); A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: B) False. 22. What are the different methods available for adding elements to a list in Python? A) Add(). B) There are several methods available for adding elements to a list in Python, including append(), extend(), insert(), and list concatenation. C) Pop(). D) Remove(). Show Answer Correct Answer: B) There are several methods available for adding elements to a list in Python, including append(), extend(), insert(), and list concatenation. 23. Which syntax correctly creates a list? A) Nums = [1, 2, 3]. B) Nums = (1, 2, 3). C) Nums = \{1, 2, 3\}. D) Nums = 1, 2, 3. Show Answer Correct Answer: A) Nums = [1, 2, 3]. 24. Consider the following two sequences:The length of longest common subsequence of X and Y is:Consider the following two sequences:X = < B, C, D, C, A, B, C >, and Y = < C, A, D, B, C, B >The length of longest common subsequence of X and Y is: A) 5. B) 3. C) 4. D) 2. Show Answer Correct Answer: C) 4. 25. In linked list each node is divided into ..... parts? A) One. B) Two. C) Three. D) Four. Show Answer Correct Answer: B) Two. ← 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 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