1. Which of the following is considered a primitive data type in most programming languages?
A) Array
B) Linked List
C) Integer
D) Stack
Correct Answer: Integer
Rationale: Primitive data types are the basic building blocks provided by programming languages and
include integers, characters, booleans, and floating-point numbers. Arrays, linked lists, and stacks are
non-primitive or abstract data structures built from primitive types.
2. What is the primary purpose of a data structure in computing?
A) To execute program instructions
B) To organize and store data efficiently
C) To compile source code
D) To manage network connections
Correct Answer: To organize and store data efficiently
Rationale: A data structure is a way of collecting and organizing data so that operations can be
performed on it effectively. It provides a framework for storing, accessing, and manipulating data. The
choice of data structure directly affects algorithm efficiency.
3. A data structure that stores subitems, with a name associated with each subitem, is known as a:
A) Array
B) Record
C) Linked List
,D) Stack
Correct Answer: Record
Rationale: A record stores subitems (often called fields) with a name associated with each subitem.
Arrays store ordered items accessible by index. Linked lists store items in nodes with pointers. Stacks
are LIFO structures.
4. Which characteristic defines an array data structure?
A) Items are stored in nodes with pointers to the next node
B) Each item is directly accessible by a positional index
C) Items are only inserted and removed from the top
D) Items are stored in key-value pairs
Correct Answer: Each item is directly accessible by a positional index
Rationale: An array stores an ordered collection of elements where each element is directly accessible
by a positional index. Node-based storage with pointers describes linked lists. Top-only access
describes stacks. Key-value pairs describe dictionaries or hash tables.
5. A linked list is best described as a data structure that:
A) Stores subitems with a name associated with each subitem
B) Stores an ordered list of items in nodes, where each node stores data and has a pointer to the next
node
C) Stores unordered items by mapping each item to a location in an array
D) Allows items to be inserted and removed only from the top
Correct Answer: Stores an ordered list of items in nodes, where each node stores data and has a
pointer to the next node
, Rationale: A linked list stores an ordered list of items in nodes, where each node stores data and has a
pointer to the next node. Records store named subitems. Hash tables use mapping. Stacks restrict
operations to the top.
6. Which abstract data type (ADT) follows the Last-In-First-Out (LIFO) principle?
A) Queue
B) Stack
C) Deque
D) Bag
Correct Answer: Stack
Rationale: A stack is an ADT in which items are only inserted on or removed from the top, following
the LIFO principle. A queue is FIFO, a deque allows removal at both ends, and a bag has no ordering.
7. Which abstract data type (ADT) follows the First-In-First-Out (FIFO) principle?
A) Stack
B) Queue
C) Deque
D) Priority Queue
Correct Answer: Queue
Rationale: A queue is an ADT in which items are inserted at the end and removed from the front,
following the FIFO principle. A stack is LIFO, a deque allows removal at both ends, and a priority
queue removes by priority.
8. A deque (double-ended queue) is an ADT in which items:
A) Are inserted and removed only from the top
B) Are inserted at the end and removed from the front