C949 - Data Structure and Algorithms Practice
Test Questions With Correct Answers
Which |data |structure |follows |the |"First-In-First-Out" |(FIFO) |principle?
a. |Stack
b. |Queue
c. |Linked |List
d. |Tree
Queue
Which |sorting |algorithm |has |a |worst-case |time |complexity |of |O(n^2)?
a. |Bubble |Sort
b. |Merge |Sort
c. |Quick |Sort
d. |Insertion |Sort
Bubble |Sort
In |a |binary |search |tree |(BST), |what |is |the |property |of |the |left |child |compared |to |the |parent |
node?
a. |It |is |greater |than |the |parent |node.
b. |It |is |less |than |the |parent |node.
c. |It |is |equal |to |the |parent |node.
d. |There |is |no |specific |relationship.
, It |is |less |than |the |parent |node.
Which |data |structure |provides |constant-time |average-case |insertion, |deletion, |and |retrieval |
operations?
a. |Array
b. |Linked |List
c. |Hash |Table
d. |Stack
Hash |Table
Which |algorithm |is |used |to |find |the |shortest |path |between |nodes |in |a |graph? |a. |Breadth-First |
Search |(BFS)
b. |Depth-First |Search |(DFS)
c. |Dijkstra's |Algorithm
d. |Bellman-Ford |Algorithm
Dijkstra's |Algorithm
Which |data |structure |uses |the |"Last-In-First-Out" |(LIFO) |principle?
a. |Queue
b. |Heap
c. |Stack
d. |Hash |Table
Stack
Test Questions With Correct Answers
Which |data |structure |follows |the |"First-In-First-Out" |(FIFO) |principle?
a. |Stack
b. |Queue
c. |Linked |List
d. |Tree
Queue
Which |sorting |algorithm |has |a |worst-case |time |complexity |of |O(n^2)?
a. |Bubble |Sort
b. |Merge |Sort
c. |Quick |Sort
d. |Insertion |Sort
Bubble |Sort
In |a |binary |search |tree |(BST), |what |is |the |property |of |the |left |child |compared |to |the |parent |
node?
a. |It |is |greater |than |the |parent |node.
b. |It |is |less |than |the |parent |node.
c. |It |is |equal |to |the |parent |node.
d. |There |is |no |specific |relationship.
, It |is |less |than |the |parent |node.
Which |data |structure |provides |constant-time |average-case |insertion, |deletion, |and |retrieval |
operations?
a. |Array
b. |Linked |List
c. |Hash |Table
d. |Stack
Hash |Table
Which |algorithm |is |used |to |find |the |shortest |path |between |nodes |in |a |graph? |a. |Breadth-First |
Search |(BFS)
b. |Depth-First |Search |(DFS)
c. |Dijkstra's |Algorithm
d. |Bellman-Ford |Algorithm
Dijkstra's |Algorithm
Which |data |structure |uses |the |"Last-In-First-Out" |(LIFO) |principle?
a. |Queue
b. |Heap
c. |Stack
d. |Hash |Table
Stack