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 9 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 9 (60 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. In ..... data structure, the data items are arranged in a linear sequence. A) Linear. B) Non linear. C) Both a and b. D) All of above. Show Answer Correct Answer: A) Linear. 2. 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. 3. There is an extra element at the head of the list called a ..... A) Antinel. B) List header. C) Sentinel. D) List head. Show Answer Correct Answer: C) Sentinel. 4. 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). 5. 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. 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) Anywhere the computer has space for them. B) In an array. C) In a structure. D) In contiguous memory locations. Show Answer Correct Answer: A) 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.dropna(). B) Df.clean(). C) Df.fillna(). D) Df.remove na(). Show Answer Correct Answer: A) 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) Stack. B) Linked list. C) Queue. D) Heap. Show Answer Correct Answer: A) Stack. 13. How many edges are present in the complete graph of n vertices? A) N/2. B) N(n+1)/2. C) N(n-1)/2. D) N. Show Answer Correct Answer: C) 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) Tuple. C) List. D) List of Lists. Show Answer Correct Answer: D) List of Lists. 16. Which is not a linear data structure? A) Linked List. B) Stack. C) Tree. D) Queue. Show Answer Correct Answer: C) Tree. 17. Which of these is not a data structure? A) Stack. B) Integer. C) Array. D) List. Show Answer Correct Answer: B) Integer. 18. 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. 19. 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. 20. A Kind of tree where every node in a tree can have at most two children. A) Binary Expression Tree. B) Tree. C) Binary Search Tree. D) Binary Tree. Show Answer Correct Answer: D) Binary Tree. 21. How do you instantiate an array in Java? A) Int arr[] = new int(3);. B) Int arr() = new int(3);. C) Int arr[];. D) Int arr[] = new int[3];. Show Answer Correct Answer: D) Int arr[] = new int[3];. 22. 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. 23. Maximum degree of any vertex in a simple graph of vertices n is A) B-n. B) C-n + 1. C) D-n-1. D) A-2n-1. Show Answer Correct Answer: C) D-n-1. 24. 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. 25. If two trees have same structure and but different node content, then they are called A) Synonyms trees. B) Equivalent trees. C) Joint trees. D) Similar trees. Show Answer Correct Answer: D) Similar trees. 26. Ordered collection of data items of the same type referred to collectively by a single name A) Array. B) Constants. C) Variables. D) List. Show Answer Correct Answer: A) Array. 27. In a B+ tree, both the internal nodes and the leaves have keys. A) 1. True. B) 2. False. C) All the above. D) None of the above. Show Answer Correct Answer: B) 2. False. 28. What is the position of the name 'Paula' in the following list:names = ["Paul", "Pranav", "Paula", "Prea"] A) 1. B) 2. C) 0. D) 3. Show Answer Correct Answer: B) 2. 29. What is a data structure used to store multiple items in Python? A) Tuple. B) Dictionary. C) List. D) Set. Show Answer Correct Answer: C) List. 30. Surbhi wants to implement a particular data structure using a static array. She uses the concept of circular list to implement the data structure, because this allows her to efficiently use all fields of the array. Which data structure is Surbhi implementing? A) Op 1:a stack. B) Op 2:a queue. C) Op 3:Binary Tree. D) Op 4:None of these. Show Answer Correct Answer: B) Op 2:a queue. 31. In this type of data structures, data values of different types are grouped, as in structures and classes. Refer to ..... A) Homogenous. B) Non-homogenous. C) All the above. D) None of the above. Show Answer Correct Answer: B) Non-homogenous. 32. Which of the following is a linear data structure? A) AVL Tree. B) List. C) Binary Tree. D) Graph. Show Answer Correct Answer: B) List. 33. Consider a singly linked list of the form where F is a pointer to the first element in the linked list and L is the pointer to the last element in the list. The time of which of the following operations depends on the length of the list? A) Delete the first element of the list. B) Delete the last element of the list. C) Add an element after the last element of the list. D) Interchange the first two elements of the list. Show Answer Correct Answer: B) Delete the last element of the list. 34. What is Big O notation and why is it important? A) Big O notation is a method for determining the best programming language to use. B) Big O notation measures the speed of a computer's processor. C) Big O notation is used to calculate the total number of lines in a program. D) Big O notation is a way to express the time or space complexity of an algorithm, indicating its efficiency as input size increases. Show Answer Correct Answer: D) Big O notation is a way to express the time or space complexity of an algorithm, indicating its efficiency as input size increases. 35. Who was the developer of c language? A) Dennis Ritchie. B) James Gosling. C) K. L. Thompson. D) None of the above. Show Answer Correct Answer: A) Dennis Ritchie. 36. What punctuation is used to signal the beginning and end of code blocks? A) { }. B) $\rightarrow$ and <-. C) BEGIN and END. D) ( and ). Show Answer Correct Answer: A) { }. 37. The data structure which expands and shrinks as per demand is called: A) Array. B) Dynamic. C) Non-linear. D) Linked list. Show Answer Correct Answer: B) Dynamic. 38. While implementing Stack using list when we want to delete element we must use pop function as ..... A) List.pop(pos). B) List.pop(1). C) List.pop(). D) List.pop(0). Show Answer Correct Answer: C) List.pop(). 39. If for an algorithm time complexity is given by O(1) then complexityof it is: A) Constant. B) Polynomial. C) Exponential. D) None of the mentioned. Show Answer Correct Answer: A) Constant. 40. D.S . stands for A) Digital Society. B) Digital Standards. C) Deputy Supreme. D) Data structure. Show Answer Correct Answer: D) Data structure. 41. The depth of a complete binary tree is given by A) Dn = n log2n. B) Dn = n log2n+1. C) Dn = log2n+1. D) Dn = log2n. Show Answer Correct Answer: C) Dn = log2n+1. 42. Which of the following data structure works on the principle of First Come First Serve? A) Tree. B) Stack. C) Linked List. D) Queue. Show Answer Correct Answer: D) Queue. 43. Assertion (A):Application of stack is to reverse a word.Reason (R):The ordering principle is LIFO. A) A is true and R is correct explanation. B) A is true and R is not correct explanation. C) A is false and R is true. D) A is false and R is also false. Show Answer Correct Answer: A) A is true and R is correct explanation. 44. The indirection operator is represented by A) *. B) &. C) ~. D) None of the above. Show Answer Correct Answer: A) *. 45. In linked list each node contain minimum of two fields. One field is data field to store the data second field is? A) Node. B) Pointer to character. C) Pointer to node. D) Pointer to integer. Show Answer Correct Answer: C) Pointer to node. 46. What happens if you attempt to pop from an empty stack? A) It throws an exception or error. B) It returns null. C) It returns a default value like 0 or None. D) It inserts a new element into the stack automatically. Show Answer Correct Answer: A) It throws an exception or error. 47. When malloc() returns NULL value, it means A) Memory is not allocated. B) Memory is allocated. C) Memory is allocated but no data entered. D) None of the above. Show Answer Correct Answer: A) Memory is not allocated. 48. Which of the following is used to declare, construct, and initialize an array? A) Int arr [] [] = {1, 2, 3, 4};. B) Int [] arr = {};. C) Int arr [] = {1, 2, 3};. D) Int [] arr = (1, 2, 3);. Show Answer Correct Answer: C) Int arr [] = {1, 2, 3};. 49. Main Operations in Queue are Called A) Enqueue and Dequeue. B) Append and Insertion. C) Push and Pop. D) Append and traverse. Show Answer Correct Answer: A) Enqueue and Dequeue. 50. What method would you use to remove a key from a dictionary? A) Use 'del' or 'pop()' method. B) Use 'clear()' method. C) Use 'remove()' method. D) Use 'discard()' method. Show Answer Correct Answer: A) Use 'del' or 'pop()' method. 51. How are arrays indexed? A) Randomly. B) Starting at 1. C) Alphabetically. D) Starting at 0. Show Answer Correct Answer: D) Starting at 0. 52. Which one of the following is an application of Queue Data Structure? A) When a resource is shared among multiple consumers. B) When data is transferred asynchronously (data not necessarily received at same rate as sent) between two processes. C) Process Scheduling. D) All the above. Show Answer Correct Answer: D) All the above. 53. What method can you use to get all the values from a dictionary? A) Dictionary.values(). B) Dictionary.allValues(). C) Dictionary.getAll(). D) Dictionary.items(). Show Answer Correct Answer: A) Dictionary.values(). 54. A variant of linked list in which last node of the list points to the first node of the list is? A) Singly linked list. B) Doubly linked list. C) Circular linked list. D) None of the above. Show Answer Correct Answer: C) Circular linked list. 55. What methods can be used to access values in a dictionary? A) Use the value directly, the find() method, or sort the dictionary. B) Utilize the item, the retrieve() method, or map through the dictionary. C) Use the key, the get() method, or iterate through the dictionary. D) Access via index, the fetch() method, or filter the dictionary. Show Answer Correct Answer: C) Use the key, the get() method, or iterate through the dictionary. 56. Searching of any element in a data structure can be done in 2 ways ..... and ..... A) Sequential and random. B) Linear and non linear. C) Linear and binary. D) Linear and random. Show Answer Correct Answer: C) Linear and binary. 57. Whoose responsibility is to choose the right data structure? A) Programmer. B) Manager. C) System Analysts. D) None of the above. Show Answer Correct Answer: A) Programmer. 58. A Balanced Tree has equal number of items on each subtree. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 59. What is the primary advantage of using functions in programming according to the fundamental principles of software development? A) Functions allow code reusability and reduce repetition. B) Functions automatically fix bugs in code. C) Functions make programs run faster. D) Functions make variables global by default. Show Answer Correct Answer: A) Functions allow code reusability and reduce repetition. 60. Inserting an element is ..... A) Ins. B) Add. C) Pop. D) Push. Show Answer Correct Answer: D) Push. ← 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