MIDTERM EXAM - Attempt Data Structures and Algorithms
MIDTERM EXAM - Attempt Data Structures and Algorithms
Question 1
Correct
It allows you to store elements so they can be located quickly using keys.
a. map
b. hash table
c. storage
d. hash map
Question 2
Correct
a. Trees
b. Binary tree
Incorrect
a. begin
b. begin()
c. start()
d. start
Question 4
Incorrect
b. binary tree
c. tree
d. root
Question 5
Correct
In a tree structure, has a parent element and zero or more children elements.
a. true
b. false
Incorrect
These are used to model electrical circuits, chemical compounds and highway maps.
a. map
b. graphs
c. directed graph
Question 7
Incorrect
a. bucket
b. bucket array
c. array
Question 8
Incorrect
b. graph
d. draw graph
Correct
a. empty()
b. empty tree
c. isEmpty()
d. empty
Question 10
Correct
It is a binary tree that stores a collection of elements with their associated keys at its nodes.
a. heap
c. heap sort
Question 11
Incorrect
a. selection sort
b. insertion sort
c. quick sort
d. mergesort
Correct
A binary tree function that removes the last node of the tree and return its element
a. remove()
b. delete(e)
c. remove(e)
d. delete()
Question 13
Correct
It uses divide-and-conquer technique to sort a list by partitioning the list into two sublists.
a. merge sort
b. insertion sort
c. quick sort
d. selection sort
Question 14
Incorrect
b. graph
c. directed graph
d. graphs
Incorrect
It is a pair of nodes.
a. edge
b. path
c. edge of tree
d. nodes
Question 16
Correct
a. breadth-first traversal
d. depth-first traversal
Question 17
Incorrect
b. p.root()
c. root
d. root()
Incorrect
a. root()
b. p.root
c. p.parent()
d. parent()
Question 19
Not answered
10 18 17 15 21 34 36 32 33 37
[1]
Answer:
Question 20
Correct
a. p.left()
b. p.left
c. left()
d. p.right()
Correct
a. TRUE
b. FALSE
Question 22
Correct
a. size()
b. entries()
d. number()
Question 23
Correct
The list is partitioned and combining the sorted lowerSublist and upperSublist is trivial.
a. quicksort
b. mergesort
d. divide-and-conquer
Incorrect
a. array
c. hash table
d. hash
Question 25
Incorrect
a. linear order
b. Children node
c. Ordered trees
Question 26
Incorrect
Merge sort combines the two sorted sublists into one sorted list.
a. false
b. true
Incorrect
A list is sorted by selecting elements in the list, one at a time, and moving them to their proper positions.
a. Quick sort
b. Selection sort
c. Insertion sort
d. Mergesort
Question 28
Incorrect
a. false
b. true
Question 29
Incorrect
a. parent
b. root()
c. p.parent()
d. parent()
Incorrect
a. erase()
b. erase(k)
c. remove()
d. erase
Question 31
Correct
a. p.children()
c. children()
d. children
Question 32
Incorrect
a. Clear
b. Empty graph
c. Empty
Correct
a. binary tree
d. tree
Question 34
Incorrect
a. true
b. false
Question 35
Incorrect
a. Binary tree
b. tree structure
c. tree
Incorrect
a. empty
b. empty()
c. Empty()
d. isEmpty()
Question 37
Correct
a. depth-first traversal
b. preorder traversal
d. breadth-first traversal
Question 38
Incorrect
b. Root()
c. p.isRoot()
d. isRoot()
Incorrect
a. true
b. false
Question 40
Incorrect
a. right subtree
b. root
c. left subtree
d. tree
Jump to...