Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 5 (60 MCQs)

Quiz Instructions

Select an option to see the correct answer instantly.

1. 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
2. In Stack Insertion and deletion of an element is done at single end called .....
3. How can you create a dictionary from two lists?
4. How do you modify an element at a specific index in a list?
5. Which data structure follows FIFO System?
6. Which of the following operations is performed more efficiently by doubly linked list than by linear linked list? (ISRO CS 2001)
7. Which of the following data structures allow insertion and deletion from both ends?
8. This structure uses a pointer to link nodes.
9. X = 5 while x > 0:print("Counting down!")
10. What is a nested list and how can you access its elements?
11. State true of false.i) A node is a parent if it has successor nodes.ii) A node is child node if out degree is one.
12. Array or linear list comes under the category of .....
13. What will be the output of the following code snippet for 1$\rightarrow$2$\rightarrow$3$\rightarrow$4$\rightarrow$5? void solve (ListNode* head) \{ while(head != NULL) \{ cout << head $\rightarrow$ data << '' "; head = head $\rightarrow$ next; \}\}
14. Quick sort follows which type of algorithm
15. Circular Queue is also known as .....
16. This stores its elements in a special type of tree where elements are sorted either natural or custom during iteration.
17. It is a linear data structure that stores a collection of elements. Operates on first in first out (FIFO) algorithm.
18. In ..... type of linked lists we can traverse in both the directions.
19. An exam was attended by 80 students. Min marks-0, Max Mark-50. I need to store the frequency of marks >30. What will be the size of the array needed for it?
20. How do you initialize an array in C?
21. 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, the number of elements present in stack are
22. Suppose each set is represented as a linked list with elements in arbitrary order. Which of the operations among union, intersection, membership, cardinality will be the slowest? (GATE CS 2004)
23. Explain the difference between a list and a tuple in Python.
24. A linked list have
25. Match the following.a) Completeness i) How long does it take to find a solutionb) Time Complexity ii) How much memory need to perform the search.c) Space Complexity iii) Is the strategy guaranteed to find the solution when there in one.
26. Compound Data structure can be ..... & .....
27. The elements of static list are stored in
28. A terminal node in a binary tree is called .....
29. Which data structure is needed to convert infix notation to postfix notation?
30. Which sorting algorithm is known for its average time complexity of O(n log n)?
31. How can you merge two dictionaries in Python?
32. How do you raise an exception in Python?
33. Can I put different data types into a set?
34. What will be the output of the program?class Main{public static void main(String args[]) {int arr[] = {10, 20, 30, 40, 50};for(int i=0; i < arr.length; i++){System.out.print(" '' + arr[i]);}}}
35. What is the syntax for creating a tuple in Python?
36. Assertion (A):A queue is a FIFO data structure.Reason (R):Addition and deletion of items takes place at same end.
37. How can you use comprehension with tuples?
38. How can you remove an item from a list by its value?
39. Which data structure allows deleting data elements from front and inserting from rear?
40. Which of the following is NOT a typical use case for a queue?
41. What methods can be used with dictionaries?
42. Arrays can have different data types?True or False?
43. Identify the data structure which allows deletions at both ends of the list but insertion at only one end.
44. What are the key-value pairs in a dictionary?
45. Which syntax correctly creates a set?
46. Records would typically be seen in use with which type of software?
47. What does the following function do for a given Linked List with first node as head? void fun1(struct node* head)\{ if(head == NULL) return; fun1(head$\rightarrow$next); printf("%d ", head$\rightarrow$data);\}
48. Which of the following principle does queue use?
49. How do you iterate over a dictionary's keys and values?
50. What are the advantages of using a set over a list?
51. How many stacks are required for reversing a word algorithm?
52. ..... is neither an algorithm nor a program.
53. The post fix form of (A + B) *C is
54. Which one of the following is the process of inserting an element in the stack?
55. What is the purpose of using sets in Python? Provide an example.
56. How many edges are in a tree?
57. List some common methods available for strings in Python.
58. The data type keyword NOT supported in C Language is:
59. Give syntax to create a node for Single linked list?
60. Can We Implement Stack Using Queue Data structure