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?

A

B-Tree

17
Q

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

A

False

18
Q

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

A

False

19
Q

ASCII is a variable-length coding scheme.

A

False

20
Q

AVL Tree is a balanced binary search tree.

A

True

21
Q

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

A

True

22
Q

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

A

True

23
Q

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

A

False

24
Q

Quick sort requires more space than Radix sort.

A

False

25
Q

Merge sort can be used both as an internal and an external sort.

A

True

26
Q

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}?

A

{81,22,44,25,56,67,38,79}

27
Q

Since Radix Sort depends on digits or letters, Radix Sort is much less flexible than other sorts.

A

True

28
Q

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

A

False

29
Q

The best method to select a pivot in quick sort is selecting the first element as pivot.

A

False

30
Q

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?

A

{19,12,14,20,25,22}

31
Q

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}?

A

{17,22,14,19,12,25,7,9}

32
Q

A heap can be used to implement a priority queue efficiently.

A

True

33
Q

What is the worst case computing time of selection sort?

A

O(n2)

34
Q

What is the worst case computing time of heap sort?

A

O(nlog2n)

35
Q

What is the worst case computing time of bubble sort?

A

O(n2)

36
Q

What is the worst case computing time of inserting an element to a heap?

A

O(log2n)

37
Q

What is the worst case computing time of retrieving (without deleting) the maximum element in a heap?

A

O(1)

38
Q
A