This quiz works best with JavaScript enabled. Home > Class 12 > Class 12 Computer Science Chapter 1 Data Structures Using Python – Quiz 19 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 19 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Consider the usual algorithm for determining whether a sequence of parentheses is balanced.The maximum number of parentheses that appear on the stack AT ANY ONE TIME when the algorithm analyzes:(()(())(())) are: A) 1. B) 2. C) 3. D) 4. Show Answer Correct Answer: C) 3. 2. How do you access the third element in a list named 'my ..... list' in Python? A) My list[2]. B) My list[3]. C) My list(2). D) My list.index(3). Show Answer Correct Answer: A) My list[2]. 3. Which of the following properties are obeyed by all three tree-traversals? A) Left subtrees are visited before right subtrees. B) Right subtrees are visited before left subtrees. C) Root node is visited before left subtree. D) Root node is visited before right subtree. Show Answer Correct Answer: A) Left subtrees are visited before right subtrees. 4. Which value does the command 'list[3]' find? A) The fourth value of 'List'. B) The third value of 'List'. C) The second value of 'List'. D) The fifth value of 'List'. Show Answer Correct Answer: A) The fourth value of 'List'. 5. Which data structure allows deleting data elements from and inserting at rear? A) Stacks. B) Queues. C) Dequeues. D) Binary search tree. Show Answer Correct Answer: B) Queues. 6. What a field does? A) Represents attribute of a entity. B) Represents properties of entity. C) A & B Both. D) None of these. Show Answer Correct Answer: C) A & B Both. 7. For the array:float stats[3];What is the range of the index? A) 0 to 3. B) 0 to 2. C) 1 to 3. D) 0 to 4. Show Answer Correct Answer: B) 0 to 2. 8. List of data in which element can be inserted and removed at the same end is called as ..... A) Array. B) Stack. C) Linked list. D) Queue. Show Answer Correct Answer: B) Stack. 9. In algorithm several statements appear in the same step A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 10. How do you create a class in Python and instantiate an object from it? A) Class MyClass:def init (self):passobj = MyClass(). B) MyClass obj = new MyClass();. C) Def MyClass():pass. D) Class MyClass() \{\}. Show Answer Correct Answer: A) Class MyClass:def init (self):passobj = MyClass(). 11. Which feature makes tuples useful as dictionary keys? A) They are immutable. B) They are always unique. C) They can be resized. D) They store key-value pairs. Show Answer Correct Answer: A) They are immutable. 12. Consider the following definition in c programming language. struct node \{ int data; struct node next; \} typedef struct node NODE; NODE *ptr; Which of the following c code is used to create new node? A) Ptr = (NODE*)malloc(sizeof(NODE));. B) Ptr = (NODE*)malloc(NODE);. C) Ptr = (NODE*)malloc(sizeof(NODE*));. D) Ptr = (NODE)malloc(sizeof(NODE));. Show Answer Correct Answer: A) Ptr = (NODE*)malloc(sizeof(NODE));. 13. How can you convert a list to a set in Python? A) Set(my list). B) Array(my list). C) Convert(my list). D) List(my list). Show Answer Correct Answer: A) Set(my list). 14. How many edges will a tree consisting of N nodes have? A) Log(N). B) N. C) N-1. D) N+1. Show Answer Correct Answer: C) N-1. 15. Which of the following is/are property/properties of a dynamic programming problem? A) Optimal substructure. B) Overlapping subproblems. C) Greedy approach. D) Both optimal substructure and overlapping subproblems. Show Answer Correct Answer: D) Both optimal substructure and overlapping subproblems. 16. What is the difference between a set and a frozenset in Python? A) A set is mutable and can be modified, while a frozenset is immutable and cannot be changed after creation. B) Both sets and frozensets are mutable and can be modified. C) A frozenset is a type of list that maintains order, while a set does not. D) Sets can contain only integers, while frozensets can contain any data type. Show Answer Correct Answer: A) A set is mutable and can be modified, while a frozenset is immutable and cannot be changed after creation. 17. A set of ordered pairs where elements are known as keys or identifiers and values or content. A) Set. B) Map. C) Priority Queue. D) Array List. Show Answer Correct Answer: B) Map. 18. Which of the following is a correct way to declare a multidimensional array in Java? A) Int[][]arr;. B) Int arr[[]];. C) Int[[]] arr;. D) Int[] arr;. Show Answer Correct Answer: A) Int[][]arr;. 19. Which one of these is correct about a set? A) X = (1, 2, 3, 4). B) X = \{1, 2, 3, 4\}. C) X = [1, 2, 3, 4]. D) X = \{"a":1, "b":2, "c":3, "d":4\}. Show Answer Correct Answer: B) X = \{1, 2, 3, 4\}. 20. Pointer is ..... data type A) Derived. B) Primary. C) User defined. D) None of above. Show Answer Correct Answer: A) Derived. 21. How do you create a button in Tkinter that performs an action when clicked?Criterion 2:Apply reasoning to solve real-world problems in various contexts A) Button = Button(root). B) Button = Button(root, text="Click Me"). C) Button = Button(root, text="Click Me", command=action). D) Button = Button("Click Me", action). Show Answer Correct Answer: C) Button = Button(root, text="Click Me", command=action). 22. What is a binary search and when is it used? A) A binary search is used to find an element in a sorted array efficiently. B) A binary search is a method for searching in a linked list. C) A binary search can find the maximum element in an array. D) A binary search is used to sort an unsorted array. Show Answer Correct Answer: A) A binary search is used to find an element in a sorted array efficiently. 23. Storage for data defined in terms of set of operations to be performed on the data A) Arrays. B) Variables. C) Abstract Data Types. D) Algorithms. Show Answer Correct Answer: C) Abstract Data Types. 24. Statement 1:When a node is split during insertion, the middle key is promoted to the parent as well as retained in right half-node.Statement 2:When a key is deleted from the leaf, it is also deleted from the non-leaf nodes of the tree. A) 1. Statement 1 is true but statement 2 is false. B) 2. Statement 2 is true but statement 1 is false. C) 3. Both the statements are true. D) 4. Both the statements are false. Show Answer Correct Answer: A) 1. Statement 1 is true but statement 2 is false. 25. Convert the following Infix expression to Postfix form using a stackx + y * z + (p * q + r) * s, Follow usual precedence rule and assume that the expression is legal. A) Xyz*+pq*r+s*+. B) Xyz*+pq*r+s+*. C) Xyz+*pq*r+s*+. D) Xyzp+**qr+s*+. Show Answer Correct Answer: A) Xyz*+pq*r+s*+. ← 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