This quiz works best with JavaScript enabled. Home > Class 12 > Class 12 Computer Science Chapter 1 Data Structures Using Python – Quiz 21 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 21 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Heap exhibits the property of a binary tree? A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 2. There is an extra element at the head of the list called a ..... A) Antinel. B) Sentinel. C) List header. D) List head. Show Answer Correct Answer: B) Sentinel. 3. Which syntax correctly creates a tuple? A) Coords = (10, 20). B) Coords = [10, 20]. C) Coords = \{10, 20\}. D) Coords = 10, 20, 'tuple'. Show Answer Correct Answer: A) Coords = (10, 20). 4. How do you determine the time complexity of a recursive algorithm? A) The time complexity is irrelevant for recursive algorithms. B) The time complexity is always O(n) regardless of the algorithm. C) The time complexity is determined by analyzing the recurrence relation and solving it using methods like the Master Theorem. D) You can determine it by counting the number of lines of code in the algorithm. Show Answer Correct Answer: C) The time complexity is determined by analyzing the recurrence relation and solving it using methods like the Master Theorem. 5. What are the advantages of using a linked list over an array? A) Advantages of linked lists over arrays include dynamic size, efficient insertions/deletions, and no need for contiguous memory allocation. B) Better performance for random access and sorting. C) Easier to implement and requires less memory. D) Fixed size and slower insertions/deletions. Show Answer Correct Answer: A) Advantages of linked lists over arrays include dynamic size, efficient insertions/deletions, and no need for contiguous memory allocation. 6. #include int main() \{ int arr[5]=\{10, 20, 30, 40, 50\}; printf("%d", arr[5]); return 0; \} A) Garbage value. B) 10. C) 50. D) None of the above. Show Answer Correct Answer: A) Garbage value. 7. What method would you use to convert a string to lowercase in Python? A) .upper(). B) .lower(). C) Strip(). D) Capitalize(). Show Answer Correct Answer: B) .lower(). 8. The elements of a linked list are stored A) In a structure. B) In an array. C) Anywhere the computer has space for them. D) In contiguous memory locations. Show Answer Correct Answer: C) Anywhere the computer has space for them. 9. What happens if you try to access a key that does not exist in a dictionary? A) It returns None. B) The dictionary is updated with a default value. C) A TypeError is raised. D) A KeyError is raised. Show Answer Correct Answer: D) A KeyError is raised. 10. Which function is used to drop missing values from a DataFrame in Pandas? A) Df.remove na(). B) Df.dropna(). C) Df.clean(). D) Df.fillna(). Show Answer Correct Answer: B) Df.dropna(). 11. ..... specifies how we enter data into our programs and what type of data we enter. A) Data type. B) Data. C) Datum. D) All of above. Show Answer Correct Answer: A) Data type. 12. What data structure is best suited for implementing undo functionality in a text editor? A) Queue. B) Stack. C) Linked list. D) Heap. Show Answer Correct Answer: B) Stack. 13. How many edges are present in the complete graph of n vertices? A) N(n-1)/2. B) N(n+1)/2. C) N. D) N/2. Show Answer Correct Answer: A) N(n-1)/2. 14. Explain the concept of recursion with an example. A) Recursion is a technique used to optimize code by removing unnecessary functions. B) Recursion is when a function is executed multiple times without calling itself. C) Recursion is a method where a function runs in a loop until a condition is met. D) Recursion is a method where a function calls itself to solve smaller instances of the same problem. Show Answer Correct Answer: D) Recursion is a method where a function calls itself to solve smaller instances of the same problem. 15. What type of structure is this in Python?shopping=[["tomato", "rice", "cheese", "milk"], ["soap", "masks", "detergent"]] A) 1D array. B) List. C) List of Lists. D) Tuple. Show Answer Correct Answer: C) List of Lists. 16. Which is not a linear data structure? A) Stack. B) Tree. C) Linked List. D) Queue. Show Answer Correct Answer: B) Tree. 17. Which function is used to read a CSV file into a DataFrame in Pandas? A) Pd.read excel(). B) Pd.read json(). C) Pd.read csv(). D) Pd.read sql(). Show Answer Correct Answer: C) Pd.read csv(). 18. Which of these is not a data structure? A) Stack. B) Array. C) Integer. D) List. Show Answer Correct Answer: C) Integer. 19. In preorder traversal of a binary tree the second step is ..... A) Traverse the right subtree. B) Traverse the left subtree. C) Traverse right subtree and visit the root. D) Visit the root. Show Answer Correct Answer: B) Traverse the left subtree. 20. What is the significance of the 'import' statement in Python modules? A) The 'import' statement is a way to comment code in Python. B) The 'import' statement is used to define functions in Python. C) The 'import' statement is only necessary for built-in modules. D) The 'import' statement is significant for code reuse and modular programming in Python and allows to import external modules. Show Answer Correct Answer: D) The 'import' statement is significant for code reuse and modular programming in Python and allows to import external modules. 21. A Kind of tree where every node in a tree can have at most two children. A) Binary Tree. B) Binary Expression Tree. C) Tree. D) Binary Search Tree. Show Answer Correct Answer: A) Binary Tree. 22. How do you instantiate an array in Java? A) Int arr[] = new int(3);. B) Int arr[];. C) Int arr[] = new int[3];. D) Int arr() = new int(3);. Show Answer Correct Answer: C) Int arr[] = new int[3];. 23. Which of the following problems can be solved using 2 pointers on linked list? A) Detecting cycle in a Linked List. B) Finding intersection of two linked lists. C) Finding middle of a linked lists. D) None of the above. Show Answer Correct Answer: D) None of the above. 24. Maximum degree of any vertex in a simple graph of vertices n is A) A-2n-1. B) B-n. C) C-n + 1. D) D-n-1. Show Answer Correct Answer: D) D-n-1. 25. Linked list data structure offers considerable saving in ..... A) Computational Time. B) Space Utilization. C) Space Utilization and Computational Time. D) Speed Utilization. Show Answer Correct Answer: C) Space Utilization and Computational Time. ← 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