WGU C949 — Data Structures and Algorithms I — 300
Original Practice Questions
1. What is the primary purpose of a data structure?
A. To define syntax rules for a programming language
B. To organize, store, and perform operations on data
C. To execute algorithms in parallel environments
D. To provide a graphical interface for databases
B. To organize, store, and perform operations on data
A data structure is fundamentally a way of organizing, storing, and performing operations
on data. Operations include accessing, updating, searching, inserting, and removing data .
2. Which data structure stores subitems with a name associated with each
subitem?
A. Array
B. Record
C. Linked list
D. Stack
B. Record
A record stores subitems, often called fields, with a name associated with each subitem.
Arrays store ordered items accessible by index; linked lists use nodes with pointers; stacks
are LIFO structures .
3. What characterizes 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
B. Each item is directly accessible by a positional index
An array stores an ordered collection of elements where each element is directly accessible
by a positional index. Option A describes linked lists; Option C describes stacks; Option D
describes dictionaries or hash tables .
4. What is an Abstract Data Type (ADT)?
A. A data type with fixed memory allocation
B. A data type described by predefined user operations without indication of
implementation
C. A data type that can only store primitive values
D. A data type built into the programming language
B. A data type described by predefined user operations without indication of
implementation
An ADT is described by predefined user operations, such as "insert data at rear," without
indicating how each operation is implemented. This abstraction separates interface from
implementation .
5. Which ADT is used for holding ordered data?
A. Bag
B. Set
C. List
D. Dictionary
C. List
A list is the ADT specifically designed for holding ordered data. Bags store unordered data
allowing duplicates; sets store distinct unordered items; dictionaries store key-value pairs .
6. What does the stack ADT use for its insertion and removal operations?
,A. FIFO (First-In First-Out)
B. LIFO (Last-In First-Out)
C. Random access
D. Priority-based access
B. LIFO (Last-In First-Out)
A stack is a LIFO (Last-In First-Out) ADT where items are only inserted on or removed from
the top of the stack. FIFO describes queues; random access describes arrays .
7. Which ADT allows items to be inserted at the end and removed from the front?
A. Stack
B. Deque
C. Queue
D. List
C. Queue
A queue is an ADT in which items are inserted at the end and removed from the front,
following FIFO (First-In First-Out) order .
8. What is a deque (double-ended queue) ADT?
A. An ADT where items can only be inserted at the front
B. An ADT where items can be inserted and removed at both the front and back
C. An ADT that stores items in priority order
D. An ADT that stores key-value pairs
B. An ADT where items can be inserted and removed at both the front and back
A deque is an ADT in which items can be inserted and removed at both the front and back.
It combines the functionality of a stack and a queue .
9. Which ADT stores items where order does not matter and duplicates are
allowed?
, A. List
B. Set
C. Bag
D. Dictionary
C. Bag
A bag is an ADT for storing items in which the order does not matter and duplicate items
are allowed. Sets allow no duplicates; lists maintain order .
10. Which ADT associates keys with values?
A. List
B. Stack
C. Dictionary (Map)
D. Queue
C. Dictionary (Map)
A dictionary (also called a map) is an ADT that associates keys with values, allowing
lookup by key rather than by position .
11. What is a singly-linked list?
A. A list where each node has a reference to both the next and previous nodes
B. A data structure where each node has data and a reference to the next node
C. A list where the tail node references the head node
D. A list stored in contiguous memory
B. A data structure where each node has data and a reference to the next node
A singly-linked list is a data structure for implementing a list ADT, where each node has
data and a reference to the next node. Doubly-linked lists have references to both next
and previous nodes .
12. In a singly-linked list, what is the first node called?
Original Practice Questions
1. What is the primary purpose of a data structure?
A. To define syntax rules for a programming language
B. To organize, store, and perform operations on data
C. To execute algorithms in parallel environments
D. To provide a graphical interface for databases
B. To organize, store, and perform operations on data
A data structure is fundamentally a way of organizing, storing, and performing operations
on data. Operations include accessing, updating, searching, inserting, and removing data .
2. Which data structure stores subitems with a name associated with each
subitem?
A. Array
B. Record
C. Linked list
D. Stack
B. Record
A record stores subitems, often called fields, with a name associated with each subitem.
Arrays store ordered items accessible by index; linked lists use nodes with pointers; stacks
are LIFO structures .
3. What characterizes 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
B. Each item is directly accessible by a positional index
An array stores an ordered collection of elements where each element is directly accessible
by a positional index. Option A describes linked lists; Option C describes stacks; Option D
describes dictionaries or hash tables .
4. What is an Abstract Data Type (ADT)?
A. A data type with fixed memory allocation
B. A data type described by predefined user operations without indication of
implementation
C. A data type that can only store primitive values
D. A data type built into the programming language
B. A data type described by predefined user operations without indication of
implementation
An ADT is described by predefined user operations, such as "insert data at rear," without
indicating how each operation is implemented. This abstraction separates interface from
implementation .
5. Which ADT is used for holding ordered data?
A. Bag
B. Set
C. List
D. Dictionary
C. List
A list is the ADT specifically designed for holding ordered data. Bags store unordered data
allowing duplicates; sets store distinct unordered items; dictionaries store key-value pairs .
6. What does the stack ADT use for its insertion and removal operations?
,A. FIFO (First-In First-Out)
B. LIFO (Last-In First-Out)
C. Random access
D. Priority-based access
B. LIFO (Last-In First-Out)
A stack is a LIFO (Last-In First-Out) ADT where items are only inserted on or removed from
the top of the stack. FIFO describes queues; random access describes arrays .
7. Which ADT allows items to be inserted at the end and removed from the front?
A. Stack
B. Deque
C. Queue
D. List
C. Queue
A queue is an ADT in which items are inserted at the end and removed from the front,
following FIFO (First-In First-Out) order .
8. What is a deque (double-ended queue) ADT?
A. An ADT where items can only be inserted at the front
B. An ADT where items can be inserted and removed at both the front and back
C. An ADT that stores items in priority order
D. An ADT that stores key-value pairs
B. An ADT where items can be inserted and removed at both the front and back
A deque is an ADT in which items can be inserted and removed at both the front and back.
It combines the functionality of a stack and a queue .
9. Which ADT stores items where order does not matter and duplicates are
allowed?
, A. List
B. Set
C. Bag
D. Dictionary
C. Bag
A bag is an ADT for storing items in which the order does not matter and duplicate items
are allowed. Sets allow no duplicates; lists maintain order .
10. Which ADT associates keys with values?
A. List
B. Stack
C. Dictionary (Map)
D. Queue
C. Dictionary (Map)
A dictionary (also called a map) is an ADT that associates keys with values, allowing
lookup by key rather than by position .
11. What is a singly-linked list?
A. A list where each node has a reference to both the next and previous nodes
B. A data structure where each node has data and a reference to the next node
C. A list where the tail node references the head node
D. A list stored in contiguous memory
B. A data structure where each node has data and a reference to the next node
A singly-linked list is a data structure for implementing a list ADT, where each node has
data and a reference to the next node. Doubly-linked lists have references to both next
and previous nodes .
12. In a singly-linked list, what is the first node called?