NEW
Font size
WorksheetsData Structures and Algorithms Quiz #1
Total questions: 35
Worksheet time: 12mins
What is a data structure?
A programming language
A way to store and organize data efficiently
A type of algorithm
A computer hardware component
Which of the following best defines an algorithm?
A data storage method
A programming syntax
A step-by-step procedure to solve a problem
A variable declaration
Which factor is NOT used to measure algorithm efficiency?
Time complexity
Space complexity
Code readability
Input size
Which data structure stores elements in a linear sequence?
Tree
Graph
Linear data structure
Hash table
Which is an example of a non-linear data structure?
Array
Linked list
Stack
Tree
Which of the following is NOT a basic data structure?
Array
Linked List
Compiler
Stack
What is the primary goal of algorithms?
Write long code
Increase memory usage
Solve problems efficiently
Reduce hardware usage
Big-O notation is used to describe:
Code syntax
Algorithm efficiency
Variable scope
Memory address
What does Big-O measure?
Best case only
Average case only
Hardware speed
Worst-case performance
An array stores elements in:
Random memory
Non-contiguous memory
Contiguous memory
Stack memory only
Array index starts from:
0
1
-1
Depends on OS
Which is NOT an array operation?
Traversal
Insertion
Rotation
Deletion
Which is a limitation of arrays?
Fast access
Fixed size
Easy traversal
Simple structure
A linked list consists of:
Index and value
Data only
Data and pointer
Pointer only
Which memory allocation is used in linked lists?
Contiguous
Static
Fixed
Dynamic
Main advantage of linked list over array?
Faster access
Dynamic size
Less memory
Indexing
What is the first node called?
Tail
Root
Head
End
Last node points to what in singly linked list?
NULL
Itself
Head
Random node
Circular linked list last node points to:
NULL
Head
Tail
Middle
Linked list is best for:
Fixed size data
Dynamic memory
Index-based access
Random access
What happens if head pointer is NULL?
List is empty
List is full
Error
Loop exists
Which linked list connects last node to first?
Single
Doublely
Circular
Linear
Circular linked list avoids:
Looping
NULL pointer
Traversal
Pointers
inked list does NOT support:
Dynamic size
Easy insertion
Traversal
Random access
Which pointer stores address of first node?
Tail
Head
Current
Next
All elements in an array must be of:
Same data type
Different data types
Mixed data types
Object type only
What happens when an element is inserted at the beginning of an array?
No change
Elements shift right
Elements shift left
Array size decreases
Array elements are accessed using:
Pointers
Keys
Links
Index
Memory for arrays is allocated:
Randomly
Contiguously
Dynamically only
In stack only
Which array index is invalid for an array of size 5?
0
2
4
5
Which condition is used to stop traversal in circular linked list?
Current == NULL
Current == head
Current == tail
Current == first node again
In circular linked list, head node is:
Always NULL
Optional
Not required
Accessible from last node
If head pointer is NULL, the list is:
Empty
Full
Invalid
Circular
Which data structure is faster for traversal?
Linked list
Array
Both same
Depends on data
Which data structure is better for frequent access operations?
Linked list
Array
Both same
None
