Questions and Answers Latest Version
Already Passed
What is a data structure?
✔✔ A way to organize and store data efficiently.
How do you access the first element of a list?
✔✔ Use the index 0.
What is the purpose of an array?
✔✔ To store multiple elements of the same type in a fixed-size structure.
How can you find the length of a list?
✔✔ Use the len() function.
What is a stack?
✔✔ A data structure that follows Last-In, First-Out (LIFO) order.
1
,How do you add an item to the end of a list?
✔✔ Use the append() method.
How can you remove the last item from a stack?
✔✔ Use the pop() method.
What is a queue?
✔✔ A data structure that follows First-In, First-Out (FIFO) order.
How do you insert an element at a specific position in a list?
✔✔ Use the insert() method.
What is a linked list?
✔✔ A sequence of nodes where each node points to the next one.
How can you check if a list is empty?
✔✔ Compare its length to zero or check if it equals an empty list.
2
, What is the difference between a stack and a queue?
✔✔ Stack uses LIFO order, while a queue uses FIFO order.
How do you remove an element from a specific position in a list?
✔✔ Use the pop() method with the index.
What is a node in a linked list?
✔✔ An element containing data and a reference to the next node.
How can you iterate over all elements in a list?
✔✔ Use a loop to access each element.
What is a binary tree?
✔✔ A hierarchical structure where each node has up to two children.
How do you access the last element of a list?
✔✔ Use the index -1.
3