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