Study Key A Content Processing Service for Students and Teachers, for Study and Evaluation
A Content Processing Service for Students and Teachers, for Study and Evaluation

Exercise 4 Solutions · Unit 4: Computational Structures

5 reading sections · 15 MCQs · 6 short · 5 long questions

All 26 Ex 4 17

Exercise 4 — Exercise 4: MCQs, short and long questions

Ex 4 · QMCQ 1 MCQ1 mark
The function used to add an item at the end of a list in Python:
(a) insert()
(b) append()
(c) remove()
(d) pop()
⚑ Report a mistake
Ex 4 · QMCQ 2 MCQ1 mark
The purpose of the in keyword used with a Python list:
(a) Adds an item to the list
(b) Removes an item from the list
(c) Checks if an item exists in the list
(d) Returns the length of the list
⚑ Report a mistake
Ex 4 · QMCQ 3 MCQ1 mark
An operation that removes an item from the top of the stack:
(a) Push
(b) Pop
(c) Peek
(d) Add
⚑ Report a mistake
Ex 4 · QMCQ 4 MCQ1 mark
The operation used to add an item to a queue:
(a) Dequeue
(b) Peek
(c) Enqueue
(d) Remove
⚑ Report a mistake
Ex 4 · QMCQ 5 MCQ1 mark
True statement about the height of a tree:
(a) Number of edges from the root to the deepest node
(b) Number of nodes from the root to the deepest node
(c) Number of children of the root node
(d) Always equal to the number of nodes in the tree
⚑ Report a mistake
Ex 4 · QMCQ 6 MCQ1 mark
A scenario where a graph data structure is most suitable:
(a) Managing a to-do list
(b) Modeling a line of customers in a store
(c) Representing connections in a social network
(d) All of the above
⚑ Report a mistake
Ex 4 · QShort 1 Short2 marks
Explain how the insert() function works in Python lists. Provide an example.
⚑ Report a mistake
Ex 4 · QShort 2 Short2 marks
Explain the potential issues which could arise when two variables reference the same list in a program. Provide an example.
⚑ Report a mistake
Ex 4 · QShort 3 Short2 marks
Define a stack and explain the Last-In, First-Out (LIFO) principle.
⚑ Report a mistake
Ex 4 · QShort 4 Short2 marks
Differentiate between the Enqueue and Dequeue operations of queue.
⚑ Report a mistake
Ex 4 · QShort 5 Short2 marks
Name two basic operations performed on stack.
⚑ Report a mistake
Ex 4 · QShort 6 Short2 marks
What is the difference between enqueue() and dequeue()?
⚑ Report a mistake
Ex 4 · QLong 1 Long5 marks
Discuss the dynamic size property of lists in Python. How does this property make lists more flexible?
⚑ Report a mistake
Ex 4 · QLong 2 LongProgram5 marks
Explain the operations on stack with real-life example and Python code.
⚑ Report a mistake
Ex 4 · QLong 3 LongProgram5 marks
Write a simple program to implement a queue (insertion and deletion).
⚑ Report a mistake
Ex 4 · QLong 4 Long5 marks
Define Tree and explain its properties.
⚑ Report a mistake
Ex 4 · QLong 5 Long5 marks
What is a graph? Explain differences between directed and undirected graphs.
⚑ Report a mistake
Something went wrong. Reload ✕