This quiz works best with JavaScript enabled. Home > Class 12 > Class 12 Computer Science Chapter 1 Data Structures Using Python – Quiz 17 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 17 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Which of the following is NOT a type of binary tree? A) Complete binary tree. B) Full binary tree. C) Balanced binary tree. D) Linear binary tree. Show Answer Correct Answer: D) Linear binary tree. 2. What is the result of the expression ' 7 // 2 ' in Python? A) 3.5. B) 3. C) 3.0. D) 4. Show Answer Correct Answer: B) 3. 3. What is the main difference between a list and a tuple? A) Lists are faster than tuples in terms of performance. B) The main difference is that lists are mutable and tuples are immutable. C) Tuples are created using square brackets, while lists use parentheses. D) Lists can contain only numbers, while tuples can contain any data type. Show Answer Correct Answer: B) The main difference is that lists are mutable and tuples are immutable. 4. The complexity of Bubble sort algorithm is A) O(n2). B) O(n). C) O(log n). D) O(n log n). Show Answer Correct Answer: A) O(n2). 5. What is the difference between a set and a dictionary? A) A set contains unique elements; a dictionary contains key-value pairs. B) A set can have duplicate elements; a dictionary cannot. C) A set is ordered; a dictionary is unordered. D) A set uses indexes; a dictionary uses lists. Show Answer Correct Answer: A) A set contains unique elements; a dictionary contains key-value pairs. 6. What is a stack and how does it operate? A) A stack is a FIFO data structure that allows enqueue and dequeue operations. B) A stack is a LIFO data structure that allows push and pop operations. C) A stack is a linear data structure that allows insertion at both ends. D) A stack is a data structure that only supports random access methods. Show Answer Correct Answer: B) A stack is a LIFO data structure that allows push and pop operations. 7. What would be the solution to the given prefix notation? A) 2. B) 5. C) 7. D) 10. Show Answer Correct Answer: A) 2. 8. Entries in a stack are "ordered" . What is the meaning of this statement? A) A collection of stacks is sortable. B) Stack entries may be compared with the '<' operation. C) The entries are stored in a linked list. D) There is a Sequential entry that is one by one. Show Answer Correct Answer: D) There is a Sequential entry that is one by one. 9. What is the role of a hash function in hash tables? A) The role of a hash function is to compress data for faster transmission. B) The role of a hash function is to sort data in ascending order. C) The role of a hash function in hash tables is to map keys to specific indices for efficient data storage and retrieval. D) The role of a hash function is to encrypt data for secure storage. Show Answer Correct Answer: C) The role of a hash function in hash tables is to map keys to specific indices for efficient data storage and retrieval. 10. How can you access the last element of a list in Python? A) List.get(-1). B) List[-1]. C) List.last(). D) List[last]. Show Answer Correct Answer: B) List[-1]. 11. Given a sequence of number below:50, 60, 40, 70, 45, 55, 30, 80, 65, 35, 25, 75, 85When creating a binary search tree, what is the height of the tree? A) 3. B) 4. C) 5. D) 6. Show Answer Correct Answer: B) 4. 12. Explain how a binary tree is a nonlinear data structure. A) A binary tree is a linear data structure with a single path. B) A binary tree organizes data in a flat structure without branches. C) A binary tree is a nonlinear data structure due to its hierarchical organization and branching nature. D) A binary tree is a simple list of elements arranged sequentially. Show Answer Correct Answer: C) A binary tree is a nonlinear data structure due to its hierarchical organization and branching nature. 13. Which is the most appropriate data structure for reversing a word? A) Stack. B) Queue. C) Hashing. D) Tree. Show Answer Correct Answer: A) Stack. 14. How do you access the second element of a tuple in Python? A) Tuple name[1]. B) Tuple name[-1]. C) Tuple name[0]. D) Tuple name[2]. Show Answer Correct Answer: A) Tuple name[1]. 15. Which of these best describes an array? A) A data structure that shows a hierarchical behaviour. B) Container of objects of similar types. C) Arrays are immutable once initialised. D) Array is not a data structure. Show Answer Correct Answer: B) Container of objects of similar types. 16. Can tuples be modified after creation? A) Tuples can have their elements changed after creation. B) No, tuples cannot be modified after creation. C) Yes, tuples can be modified after creation. D) Tuples can be resized after creation. Show Answer Correct Answer: B) No, tuples cannot be modified after creation. 17. What is the difference between lists and arrays in Python? A) Lists are contiguous, but arrays are not. B) Arrays are only used in Python 2. C) There is no difference. D) Arrays are contiguous, but lists are not. Show Answer Correct Answer: D) Arrays are contiguous, but lists are not. 18. What is a set in Python? A) A collection of unique, unordered elements. B) A collection of ordered, changeable elements. C) A key-value store. D) A fixed sequence. Show Answer Correct Answer: A) A collection of unique, unordered elements. 19. What are the advantages of using tuples over lists in Python? A) Tuples can be modified after creation. B) Advantages of using tuples over lists include immutability, lower memory usage, ability to be used as dictionary keys, and simpler syntax. C) Lists use less memory than tuples. D) Tuples cannot be used as keys in dictionaries. Show Answer Correct Answer: B) Advantages of using tuples over lists include immutability, lower memory usage, ability to be used as dictionary keys, and simpler syntax. 20. How do you implement a stack in Python? A) Stack = []; item = stack.pop(); stack.append(item); is empty = not stack;. B) Stack = []; stack.append(item); item = stack.pop(); is empty = len(stack) == 0;. C) Stack = \{\}; stack.push(item); item = stack.remove(); is empty = stack.size() == 0;. D) Stack = []; stack.add(item); item = stack.delete(); is empty = stack.length() == 0;. Show Answer Correct Answer: B) Stack = []; stack.append(item); item = stack.pop(); is empty = len(stack) == 0;. 21. If you have a function that calculates area and you want to reuse it in multiple projects, which programming principle does this demonstrate? A) Code compilation. B) Code encryption. C) Code modularity and reusability. D) Code optimization. Show Answer Correct Answer: C) Code modularity and reusability. 22. What is the main characteristic of a stack? A) It follows the First In First Out (FIFO) principle. B) It follows the Last In First Out (LIFO) principle. C) It is a dynamic data structure. D) It allows random access to elements. Show Answer Correct Answer: B) It follows the Last In First Out (LIFO) principle. 23. Linked lists are not suitable to for the implementation of? A) Insertion sort. B) Radix sort. C) Polynomial manipulation. D) Binary search. Show Answer Correct Answer: D) Binary search. 24. Select the non-linear data structure from the options below: A) Queue. B) Linked list. C) Array. D) Tree. Show Answer Correct Answer: D) Tree. 25. The data structure required to check whether an expression contains balanced parenthesis is? A) Stack. B) Queue. C) Array. D) Tree. Show Answer Correct Answer: A) Stack. ← 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