final exam_DIS Flashcards

1
Q

In the graph given below, which of the following nodes will be visited last if you apply breadth-first search starting from A?

A

H

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

An algorithm to traverse a directed graph must mark vertices when they have been visited.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Shortest path problem can be solved with an easy modification of the depth-first search algorithm

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Depth-first search can use a queue for tracking visited nodes.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Breadth-first search can use a queue for tracking visited nodes

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Adjacency matrix representation causes redundancy in undirected graphs since the matrix is always symmetric.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Depth-first search starts from the root of the graph.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Traveling salesman problem is an NP-complete problem.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Red-Black Tree does not need rotations since recoloring always keeps the tree balanced

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

If your application involves frequent insertions and deletions, then Red-Black tree should be preferred to AVL tree.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Each node stores at most 4 data values in a 2-3-4 Tree

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

The root of the tree is always red in a red-black tree.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

In a directed graph, there may not be a path from one node to another.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

There must be a root node in a directed graph which does not have an incoming arc

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

All the leaves are on the same level in a 2-3-4 Tree

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Which of the following tree is used for external search?

17
Q

A rotation is needed in an AVL Tree when the balance factor of a node becomes -3 or +3 after insertion

18
Q

One simple rotation is sufficient to keep AVL Tree balanced after each insertion or deletion

19
Q

ASCII is a variable-length coding scheme.

20
Q

AVL Tree is a balanced binary search tree.

21
Q

The worst case search time in AVL Tree is O(log2n)

22
Q

The worst case computing time of merge sort is O(n*logn).

23
Q

Radix sort operates in O(n+w) time, where w is the number of digits.

24
Q

Quick sort requires more space than Radix sort.

25
Merge sort can be used both as an internal and an external sort.
True
26
Which of the following array is created after the first iteration of Radix sort, when the array contains {67,22,44,79,25,81,56,38}?
{81,22,44,25,56,67,38,79}
27
Since Radix Sort depends on digits or letters, Radix Sort is much less flexible than other sorts.
True
28
The worst case computing time of quick sort is O(n*logn).
False
29
The best method to select a pivot in quick sort is selecting the first element as pivot.
False
30
Which of the following array is the result of the split operation, when the array contains {20,22,14,19,25,12} and 20 is selected as pivot in quick sort?
{19,12,14,20,25,22}
31
Which of the following array is created after the first iteration of binary merge sort, when the array contains {17,22,14,19,25,12,9,7}?
{17,22,14,19,12,25,7,9}
32
A heap can be used to implement a priority queue efficiently.
True
33
What is the worst case computing time of selection sort?
O(n2)
34
What is the worst case computing time of heap sort?
O(nlog2n)
35
What is the worst case computing time of bubble sort?
O(n2)
36
What is the worst case computing time of inserting an element to a heap?
O(log2n)
37
What is the worst case computing time of retrieving (without deleting) the maximum element in a heap?
O(1)
38