This quiz works best with JavaScript enabled. Home > Cbse > Class 12 > Science > Computer Science > Class 12 Computer Science Chapter 1 Data Structures Using Python – Quiz 10 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 10 (60 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Routine to delete element in an array implementation of List A) For(i=pos-1;i B) For(i=pos-1;i C) For(i=pos-1;i D) For(i=pos-1;i Show Answer Correct Answer: D) For(i=pos-1;i 2. Which of the following statement(s) about stack data structure is/are NOT correct? A) Top of the Stack always contain the new node. B) Linked List are used for implementing Stacks. C) Stack is the FIFO data structure. D) Null link is present in the last node at the bottom of the stack. Show Answer Correct Answer: C) Stack is the FIFO data structure. 3. Collection of related field or items is called A) Record. B) File. C) A &B. D) None of the above. Show Answer Correct Answer: B) File. 4. Why are sets useful? A) They ensure all values remain unique. B) They keep values in order. C) They store key-value pairs. D) They preserve duplicates. Show Answer Correct Answer: A) They ensure all values remain unique. 5. When analyzing the syntax 'def fun():', what would happen if you wrote 'def fun' without the parentheses and colon? A) The function would work normally. B) Python would throw a syntax error. C) Python would create a variable instead of a function. D) The function would only work once. Show Answer Correct Answer: B) Python would throw a syntax error. 6. In the context of 'String slicing' mentioned in activity 14, what advantage does this provide in function implementation? A) It converts strings to integers. B) It makes strings immutable. C) It allows access to specific portions of strings without loops. D) It automatically sorts string characters. Show Answer Correct Answer: C) It allows access to specific portions of strings without loops. 7. Which of these data structures is FIFO? A) Stack. B) Linked List. C) Queue. D) Binary Tree. Show Answer Correct Answer: C) Queue. 8. In a circular queue, how do you calculate the length of the queue? A) Rear-Front-1. B) Size of the array-(Front-Rear). C) Rear-Front. D) Rear-Front + 1. Show Answer Correct Answer: D) Rear-Front + 1. 9. What method would you use to add an element to a list? A) Use the 'add()' method. B) Use the 'extend()' method. C) Use the 'insert()' method. D) Use the 'append()' method. Show Answer Correct Answer: D) Use the 'append()' method. 10. Which of the following rotations is called double rotation? A) RR and LR. B) LL and RL. C) LL and RR. D) LR and RL. Show Answer Correct Answer: D) LR and RL. 11. What is the information, which a LinkedList's Node must store? A) The address of the next node if it exists. B) The value of the current node. C) Both (A) and (B). D) None of the above. Show Answer Correct Answer: C) Both (A) and (B). 12. Time complexity of matrix multiplication: A) O(n). B) O(log n). C) O(n$^{3}$). D) O(n$^{2}$). Show Answer Correct Answer: C) O(n$^{3}$). 13. List some common string methods in Python. A) ['lower()', 'upper()', 'strip()', 'replace()', 'split()']. B) Concat(). C) Find(). D) Join(). Show Answer Correct Answer: A) ['lower()', 'upper()', 'strip()', 'replace()', 'split()']. 14. A FIFO structure implemented as a ring where the front and rear pointers can wrap around the end of the start of the array. A) Linear Queue. B) Circular Queue. C) Priority Queue. D) None of the above. Show Answer Correct Answer: B) Circular Queue. 15. What are the advantages of using list comprehension? A) List comprehension is only useful for large datasets. B) It simplifies debugging and error handling. C) Advantages of using list comprehension include improved readability, reduced code length, and potentially better performance. D) List comprehension can only be used with strings. Show Answer Correct Answer: C) Advantages of using list comprehension include improved readability, reduced code length, and potentially better performance. 16. What are the worst case and average case complexities of a binary search tree? A) O(n), O(logn). B) O(logn), O(logn). C) O(logn), O(n). D) O(n), O(n). Show Answer Correct Answer: A) O(n), O(logn). 17. What does it mean when an array is described as 'static'? A) It moves around in memory. B) It can only hold string data types. C) It cannot change size once set up. D) It can change size. Show Answer Correct Answer: C) It cannot change size once set up. 18. You are given a knapsack that can carry a maximum weight of 60. There are 4 items with weights {20, 30, 40, 70} and values {70, 80, 90, 200}. What is the maximum value of the items you can carry using the knapsack? A) 200. B) 160. C) 90. D) 170. Show Answer Correct Answer: B) 160. 19. How do you analyze the time complexity of an algorithm? A) Time complexity is determined solely by the programming language used. B) Time complexity is irrelevant to algorithm performance. C) Time complexity can only be analyzed using linear equations. D) Time complexity is analyzed by identifying basic operations, assessing growth with input size, and using Big O notation. Show Answer Correct Answer: D) Time complexity is analyzed by identifying basic operations, assessing growth with input size, and using Big O notation. 20. What is a correct way to visualize a four-dimensional array? A) As a single point. B) As a set of cubes. C) As a set of lines. D) As a set of tables. Show Answer Correct Answer: B) As a set of cubes. 21. Which of the following can be done with LinkedList? A) Implementation of Stacks and Queues. B) Implementation of Binary Trees. C) Implementation of Abstract Data Structures with dynamic memory allocation. D) All of the above. Show Answer Correct Answer: D) All of the above. 22. Which type of traversal of binary search tree outputs the value in sorted order? A) Pre-order. B) Post-order. C) In-Order. D) None. Show Answer Correct Answer: C) In-Order. 23. Which method would you use to retrieve a value from a dictionary using a key? A) Use parentheses to access the value. B) Use square bracket notation or the get() method. C) Use the index method to retrieve the value. D) Call the dictionary with the key as an argument. Show Answer Correct Answer: B) Use square bracket notation or the get() method. 24. Consider the following pseudocode that uses a stackdeclare a stack of characterswhile ( there are more characters in the word to read ){ { read a character push the character on the stack}while ( the stack is not empty ){ pop a character off the stack write the character to the screen}What is output for input "computer" ? A) Retupmoc. B) Computer. C) Retupmocretupmoc. D) Computercomputer. Show Answer Correct Answer: A) Retupmoc. 25. What are tuples and how are they different from lists? A) Tuples are immutable ordered collections, while lists are mutable ordered collections. B) Tuples are mutable unordered collections, while lists are immutable ordered collections. C) Tuples are ordered collections that can be changed, while lists cannot. D) Tuples are unordered collections, whereas lists are ordered collections. Show Answer Correct Answer: A) Tuples are immutable ordered collections, while lists are mutable ordered collections. 26. ..... is a collection of elements used to store the same type of data. A) Array. B) Switch. C) Loop. D) Case. Show Answer Correct Answer: A) Array. 27. List two operations that can be performed on data structures. A) Searching, Merging. B) Insertion, Deletion. C) Filtering, Grouping. D) Traversal, Sorting. Show Answer Correct Answer: B) Insertion, Deletion. 28. What is the range of floating point number in C? A) 1.7 e-308 to 1.7 e +308. B) 3.4 e-38 to 3.4 e +38. C) 1.7 e-38 to 1.7 e +38. D) 3.4 e-308 to 3.4 e +308. Show Answer Correct Answer: B) 3.4 e-38 to 3.4 e +38. 29. In a full binary tree if number of internal nodes is I, then number of leaves L are? A) L = I-1. B) L = 2*I. C) L = 2*I-1. D) L = I + 1. Show Answer Correct Answer: D) L = I + 1. 30. A Data Structure is: A) A C++ vector. B) A way of organizing, storing and performing operations on data. C) A function in any programming language. D) A sequence of steps to solve a problem. Show Answer Correct Answer: B) A way of organizing, storing and performing operations on data. 31. Elements can be removed from a stack from A) Top. B) Bottom. C) Anywhere like array. D) None of the above. Show Answer Correct Answer: A) Top. 32. The two major factors of data structure complexity are: A) Time and location. B) Type and size. C) Time and memory. D) Type and space. Show Answer Correct Answer: C) Time and memory. 33. Binart search requires sorted aaray A) Yes. B) No. C) All the above. D) None of the above. Show Answer Correct Answer: A) Yes. 34. Int nums[ ] = {2, 3, 5, 8, 9, 11};How would you access the fourth element in nums A) Nums[3]. B) Nums(4). C) Nums(3). D) Nums[8]. Show Answer Correct Answer: A) Nums[3]. 35. Consider the following numbers 8, 1, 2, 4, 3, 9, 6, 5 to be inserted into the empty binary search tree. What will be the sequence of in-order traversal of the resultant binary search tree? A) 8 1 2 4 3 9 6 5. B) 1 2 3 4 5 6 8 9. C) 8 1 3 5 6 9 2 4. D) 5 6 9 3 4 2 1 8. Show Answer Correct Answer: B) 1 2 3 4 5 6 8 9. 36. Data structure= Organized data + ..... A) Allowed operations on it. B) Allowed functions on it. C) None of the above. D) None of the above. Show Answer Correct Answer: A) Allowed operations on it. 37. How do you insert a new node at the beginning of a singly linked list in Python? A) Create a new node and set its next reference to the current head, then update the head to the new node. B) Traverse to the end of the list and add the new node there. C) Replace the data in the head node with the new data. D) Use the insert() method provided by Python lists. Show Answer Correct Answer: A) Create a new node and set its next reference to the current head, then update the head to the new node. 38. In Queue we can not insert an element in between the elements that are already inserted but we can delete it. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: B) False. 39. How many null pointers exists in a circular linked list? A) 1. B) 2. C) 3. D) 0. Show Answer Correct Answer: D) 0. 40. In circular linked list, insertion of node requires modification of? A) One pointer. B) Two pointer. C) Three pointer. D) None. Show Answer Correct Answer: B) Two pointer. 41. What is the way to increment the rear end of a circular queue? A) Rear mod MAX. B) (Front+1) mod MAX. C) (Rear-1) mod MAX. D) (Rear+1) mod MAX. Show Answer Correct Answer: D) (Rear+1) mod MAX. 42. What is the main difference between a list and a tuple in Python? A) Tuples are created using square brackets while lists use parentheses. B) Lists are faster than tuples in all operations. C) The main difference is that lists are mutable and tuples are immutable. D) Lists can contain only numbers while tuples can contain any data type. Show Answer Correct Answer: C) The main difference is that lists are mutable and tuples are immutable. 43. Compression techniques can be used on the keys to reduce both space and time requirements in a B-tree. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 44. It is used to implement an associative array, a structure that can map keys to values. A) Hashing. B) Trees. C) Array. D) Linked list. Show Answer Correct Answer: A) Hashing. 45. How many nodes does a full binary tree with n leaves contains? A) N-1. B) 2*n-1. C) N. D) 2$^{n }$. Show Answer Correct Answer: B) 2*n-1. 46. The elements in a queue are added at one end called ..... A) Front. B) Rear. C) Near. D) None of above. Show Answer Correct Answer: B) Rear. 47. Which is a Linear data structure? A) Linked List. B) Tree. C) Graph. D) All of these. Show Answer Correct Answer: A) Linked List. 48. Which of the following data structure is linear type? A) Stack. B) Array. C) Queue. D) All of the above. Show Answer Correct Answer: D) All of the above. 49. The disadvantage in using a circular linked list is ..... A) Time consuming. B) Last node points to fist node. C) Requires more memory space. D) It is possible to get into infinite loop. Show Answer Correct Answer: D) It is possible to get into infinite loop. 50. What is the syntax for creating a dictionary in Python? A) {key; value}. B) {key:value}. C) [key, value]. D) (key, value). Show Answer Correct Answer: B) {key:value}. 51. A linked list is a collection of A) Arrays. B) Data. C) Pointers. D) Nodes. Show Answer Correct Answer: D) Nodes. 52. Consider an undirected graph with weighted edges, where the weights represent the cost of traversal between nodes. You are tasked with finding the path between two nodes with the minimum total cost. Which traversal algorithm is more suitable for this scenario? A) BFS. B) DFS. C) Both DFS and BFS. D) It depends on specific graph. Show Answer Correct Answer: A) BFS. 53. What is list comprehension in Python? A) List comprehension is a method for sorting dictionaries in Python. B) List comprehension in Python is a syntactic construct for creating lists based on existing lists, using a compact syntax. C) List comprehension allows for the creation of tuples from lists in Python. D) List comprehension is a way to define functions in Python. Show Answer Correct Answer: B) List comprehension in Python is a syntactic construct for creating lists based on existing lists, using a compact syntax. 54. To perform level-order traversal on a binary tree, which of thefollowing data structure will be required? A) Queue. B) Binary search tree. C) Hash table. D) Stack. Show Answer Correct Answer: A) Queue. 55. The operation to arrange all elements in required order is called: A) Insertion. B) Search. C) Merging. D) Sorting. Show Answer Correct Answer: D) Sorting. 56. How are String represented in memory in C? A) Same as other primitive data types. B) An array of characters. C) LinkedList of characters. D) The object of some class. Show Answer Correct Answer: B) An array of characters. 57. For 'Calculating Surface Area and Volume' activity, what type of function design would be most appropriate? A) A function that stores results in global variables. B) Two separate functions, one for each calculation. C) A function that only prints results without returning values. D) One function that calculates both values and returns a tuple. Show Answer Correct Answer: D) One function that calculates both values and returns a tuple. 58. Which method is used to view the first few rows of a DataFrame? A) Df.column name. B) Df[ "column name" ]. C) Df.select( "column name" ). D) Both A and B. Show Answer Correct Answer: D) Both A and B. 59. The number of elements in the adjacency matrix of a graph having 7 vertices is A) 7. B) 14. C) 49. D) 34. Show Answer Correct Answer: C) 49. 60. Which syntax correctly creates a dictionary? A) Student = {"name": "Alex", "gpa":3.5}. B) Student = ("name", "Alex"). C) Student = {"name", "Alex"}. D) Student = ["name", "Alex"]. Show Answer Correct Answer: A) Student = {"name": "Alex", "gpa":3.5}. ← PreviousNext →Related QuizzesScience QuizzesClass 12 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 8 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books