NEW
Font size
WorksheetsBasics of Data Structure
Total questions: 20
Worksheet time: 11mins
Example of non linear data structure
array
tree
queue
stack
Which of these data structures is LIFO?
Stack
Queue
Binary Tree
Double linked list
int nums[ ] =
{2, 3, 5, 8, 9, 11};
How would you access the fourth element in nums
nums[8]
nums[3]
nums(4)
nums(3)
A FIFO structure implemented as a ring where the front and rear pointers can wrap around the end of the start of the array.
Linear Queue
Circular Queue
Priority Queue
LIFO stands for
List of Outputs
Last in First Out
First in Last Out
None of them
Act of adding values into a stack is called
Popping
Polling
Pushing
None
If the elements “A”, “B”, “C” and “D” are placed in a stack and are deleted one at a time, in what order will they be removed?
ABCD
DCBA
DCAB
ABDC
In some languages, arrays are also called ___
groups or arrows
roots or leaves
lists or vectors
lines or strings
A data type that can be used to group items of possibly different types into a single type is called ___
a root
a struct
a tree
a pointer
A flexible data structure that can store many nodes is called ___
a tree
a linked list
a pointer
a queue
When linked lists are used as stacks, what kind of behaviour is implemented?
First-In First-Out, or FIFO
First-In Last-Out, or FILO
Last-In Last-Out, or LILO
Last-In First-Out, or LIFO
In a tree data structure, the top most node is called ___
the peak
the apex
the crown
the root
In a tree data structure, any nodes that hang from other nodes are called ___
branched nodes
leaf nodes
children nodes
daughter nodes
In a tree data structure, any nodes that have no children (where the tree ends) are called ___
boundary nodes
leaf nodes
orphan nodes
terminal nodes
What is the value of the ROOT node in this Tree?
35
24
42
20
Root
data structure similar to a graph, with no loops.
an object in a graph also known as a vertex
a join of relationship between nodes - also know as an arc
the starting node in a rooted tree structure from which all other nodes branch off./
Tree
data structure similar to a graph, with no loops.
an object in a graph also known as a vertex
a join of relationship between nodes - also know as an arc
the starting node in a rooted tree structure from which all other nodes branch off./
How many leaf are there in the tree?
1
3
4
7
