This quiz works best with JavaScript enabled. Home > Class 12 > 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 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. What is the correct way to create a set in Python? A) Set = [1, 2, 3]. B) Set = (1, 2, 3). C) Set = \{1, 2, 3\}. D) Set = <1, 2, 3>. Show Answer Correct Answer: C) Set = \{1, 2, 3\}. 2. What method in Python is used to check if a key exists in a dictionary? A) Check(). B) Contains(). C) Exists(). D) In(). Show Answer Correct Answer: D) In(). 3. The optimal data structure used to solve Tower of Hanoi is ..... A) Tree. B) Heap. C) Priority queue. D) Stack. Show Answer Correct Answer: D) Stack. 4. What is the name given to a number that corresponds to the location of an item of data in an array? A) Initial. B) Primary. C) Index. D) Identifier. Show Answer Correct Answer: C) Index. 5. How do you access the value for a key? A) Student["name"]. B) Student.name. C) Student(0). D) Student$\rightarrow$name. Show Answer Correct Answer: A) Student["name"]. 6. How do you add an element to the end of a list in Python? A) List.append(element). B) List.add(element). C) List.push(element). D) List.insert(element). Show Answer Correct Answer: A) List.append(element). 7. Arranging elements of a data structure in increasing or decreasing order is known as ..... A) Searching. B) Arrangement. C) Sorting. D) Indexing. Show Answer Correct Answer: C) Sorting. 8. Consider the following operation performed on a stack of size 5.Push(1);Pop();Push(2);Push(3);Pop();Push(4);Pop();Pop();Push(5);After the completion of all operation, get the total number of element present in stack is A) 1. B) 2. C) 3. D) 4. Show Answer Correct Answer: A) 1. 9. To measure Time complexity of an algorithm Big O notation is used which: A) Describes limiting behaviour of the function. B) Characterises a function based on growth of function. C) Upper bound on growth rate of the function. D) All of the mentioned. Show Answer Correct Answer: D) All of the mentioned. 10. What is the difference between linear search and binary search? A) Linear search is O(n) and works on unsorted lists; binary search is O(log n) and requires sorted lists. B) Linear search is faster than binary search for large datasets. C) Linear search requires a sorted list to function properly. D) Binary search can be used on unsorted lists without any preprocessing. Show Answer Correct Answer: A) Linear search is O(n) and works on unsorted lists; binary search is O(log n) and requires sorted lists. 11. Stacks follows ..... order A) FIFO (First In First Out ). B) LIFO (Last In First Out). C) Random. D) FILO(First In Last Out). Show Answer Correct Answer: B) LIFO (Last In First Out). 12. Which data structure in Python follows the First In First Out (FIFO) principle? A) Array. B) Set. C) Queue. D) Stack. Show Answer Correct Answer: C) Queue. 13. A Binary Tree can have A) Can have 2 children. B) Can have 1 children. C) Can have 0 children. D) All of the above. Show Answer Correct Answer: D) All of the above. 14. Queue Implementation using Array. Array name is Queuearray and rear is the current element pointer and "data" is the new item to be added. For adding a new element int the queue, is the following statement correct? queue[rear] = data;Queuearray[rear] = data; A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: B) False. 15. A complete binary tree with 5 levels has how many nodes? (Root is Level 1) A) Op 1:15. B) Op 2:25. C) Op 3:63. D) Op 4:31. Show Answer Correct Answer: D) Op 4:31. 16. When designing a function for 'Multiplying Numbers', what parameter design would provide the most flexibility? A) Accept only string parameters. B) Accept a variable number of parameters (*args). C) Accept exactly two parameters only. D) Accept no parameters and use global variables. Show Answer Correct Answer: B) Accept a variable number of parameters (*args). 17. How can we describe an array in the best possible way? A) The Array shows a hierarchical structure. B) The Array shows a hierarchical structure. C) The Array is not a data structure. D) Container that stores the elements of similar types. Show Answer Correct Answer: D) Container that stores the elements of similar types. 18. In ..... , search start at the beginning of the list and check every element in the list. A) Binary Search. B) Binary Tree Search. C) Hash Search. D) Linear Search. Show Answer Correct Answer: D) Linear Search. 19. ..... approach is best to solve 0/1 Knapsack problem A) Greedy. B) Divide and Conquer. C) Dynamic Programming. D) Iterative. Show Answer Correct Answer: C) Dynamic Programming. 20. A record allows multiple data items to be stored using ..... ..... to identify each item of data A) Record entries. B) Table references. C) Array lists. D) Field names. Show Answer Correct Answer: D) Field names. 21. If the elements "A" , "B" , "C" and "D" are placed in a queue and are deleted one at a time, in what order will they be removed? A) ABCD. B) DCBA. C) DCAB. D) ABDC. Show Answer Correct Answer: A) ABCD. 22. Example of linear data structure except A) Array. B) Tree. C) Queue. D) Stack. Show Answer Correct Answer: B) Tree. 23. Which of the following best describes the purpose of a try-except block in Python?Criterion 2:Apply reasoning to solve real-world problems in various contexts A) It prevents a program from crashing due to errors. B) It ensures the program runs faster. C) It makes code more readable. D) It helps to store large amounts of data. Show Answer Correct Answer: A) It prevents a program from crashing due to errors. 24. In Stack Insertion and deletion of an element is done at single end called ..... A) Bottom. B) Top. C) Start. D) Last. Show Answer Correct Answer: B) Top. 25. How can you create a dictionary from two lists? A) Use dict(zip(list1, list2)). B) Use list(zip(list1, list2)). C) Use dict(list1, list2). D) Use zip(list1, list2). Show Answer Correct Answer: A) Use dict(zip(list1, list2)). ← 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 11 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books