## ITE6201 Data Structures and Algorithms(Final Q1, Q2 & Final Exam)

### Question 1

Answer saved
Marked out of 1.00
Flag question

#### Question text

The complexity of bubble sort algorithm.

Select one:

### Question 2

Answer saved
Marked out of 1.00
Flag question

#### Question text

TREE[1]=NULL indicates tree is _________

Select one:

### Question 3

Answer saved
Marked out of 1.00
Flag question

#### Question text

The rearranging of pairs of elements which are out of order, until no such pairs remain.

Select one:

### Question 4

Answer saved
Marked out of 1.00
Flag question

#### Question text

In binary trees, nodes with no successor are called _______________.

Select one:

### Question 5

Answer saved
Marked out of 1.00
Flag question

#### Question text

Binary search algorithm cannot be applied to _______________.

Select one:

### Question 6

Answer saved
Marked out of 1.00
Flag question

#### Question text

Trees are ________ if they are similar and have the same contents at corresponding nodes.

Select one:

### Question 7

Answer saved
Marked out of 1.00
Flag question

#### Question text

These are binary trees with threads.

Select one:

### Question 8

Answer saved
Marked out of 1.00
Flag question

#### Question text

Every node N in a binary tree T except the root has a unique parent called the ________ of N.

Select one:

### Question 9

Answer saved
Marked out of 1.00
Flag question

#### Question text

__________________ is putting an element in the appropriate place in a sorted list yields a larger sorted order list.

Select one:

### Question 10

Answer saved
Marked out of 1.00
Flag question

#### Question text

Sorting algorithm can be characterized as ________________.

Select one:

### Question 1

Answer saved
Marked out of 1.00
Flag question

#### Question text

Which of the following data structure is non-linear type?

Select one:

### Question 2

Answer saved
Marked out of 1.00
Flag question

#### Question text

Indicate which structure would be a more suitable choice for each of the following applications.

A program to receive data that is to be saved and processed in the reverse order.

Select one:

### Question 3

Answer saved
Marked out of 1.00
Flag question

#### Question text

____________________ level is where the model becomes compatible executable code.

Select one:

### Question 4

Answer saved
Marked out of 1.00
Flag question

#### Question text

The following algorithm is a count-controlled loop going from 1 through 5.  At each iteration, the loop counter is either printed or put on a queue depending on the result of Boolean function RanFun().  (The behavior of RanFun() is immaterial.)  At the end of the loop, the items on the queue are dequeued and printed.  Because of the logical properties of a queue, this algorithm cannot print certain sequences of the values of the loop counter.  You are given an output and asked if the algorithm could generate the output.

Set count to 0

WHILE (count < 5)

Set count to count + 1

IF (RanFun())

Write count, ' '

ELSE

Enqueue(myQueue, count)

WHILE (NOT IsEmpty(myQueue))

Dequeue(myQueue, number)

Write number, ' '

The following output is possible using a queue: 1 3 5 4 2

Select one:

### Question 5

Answer saved
Marked out of 1.00
Flag question

#### Question text

Draw the binary search tree whose elements are inserted in the following order:

50 72 96 94 107 26 12 11 9 2 10 25 51 16 17 95

If Print is applied to the tree formed above, in which order would the elements be printed?

### Question 6

Answer saved
Marked out of 1.00
Flag question

#### Question text

The value in the left child of a node (if it exists) in a binary search tree will be greater than the value in the node itself.

Select one:

### Question 7

Answer saved
Marked out of 1.00
Flag question

#### Question text

A list may be linear or nonlinear, depending on its implementation.

Select one:

### Question 8

Answer saved
Marked out of 1.00
Flag question

#### Question text

A binary tree is a tree in which each node can have zero, one, or two children.

Select one:

### Question 9

Answer saved
Marked out of 1.00
Flag question

#### Question text

The root of a tree is the node that has no ancestors.

Select one:

### Question 10

Answer saved
Marked out of 1.00
Flag question

#### Question text

Algorithms that use a list must know whether the list is array based or linked.

Select one:

### Question 1

Answer saved
Marked out of 1.00
Flag question

#### Question text

____________________ level is where the model becomes compatible executable code.

Select one:

### Question 2

Answer saved
Marked out of 1.00
Flag question

#### Question text

On average, searching in a binary search tree is faster than searching in a list.

Select one:

### Question 3

Answer saved
Marked out of 1.00
Flag question

#### Question text

A list may be linear or nonlinear, depending on its implementation.

Select one:

### Question 4

Answer saved
Marked out of 1.00
Flag question

#### Question text

Indicate which structure would be a more suitable choice for each of the following applications.

A program to receive data that is to be saved and processed in the reverse order.

Select one:

### Question 5

Answer saved
Marked out of 1.00
Flag question

#### Question text

Indicate which structure would be a more suitable choice for each of the following applications.

A program keeping track of where canned goods are located on a shelf.

Select one:

### Question 6

Answer saved
Marked out of 1.00
Flag question

#### Question text

Which of the following is true about the characteristics of abstract data types?

i. It exports a type.

ii. It exports a set of operations.

Select one:

### Question 7

Answer saved
Marked out of 1.00
Flag question

#### Question text

Draw the binary search tree whose elements are inserted in the following order:

50 72 96 94 107 26 12 11 9 2 10 25 51 16 17 95

If Print is applied to the tree formed above, in which order would the elements be printed?

### Question 8

Answer saved
Marked out of 1.00
Flag question

#### Question text

A binary search tree whose left subtree and right subtree differ in height by at most 1 unit is called ____________________.

Select one:

### Question 9

Answer saved
Marked out of 1.00
Flag question

#### Question text

A leaf in a tree is a node with no children.

Select one:

### Question 10

Answer saved
Marked out of 1.00
Flag question

#### Question text

In a graph, the vertices represent the items being modeled.

Select one:

### Question 11

Answer saved
Marked out of 1.00
Flag question

#### Question text

The value in the left child of a node (if it exists) in a binary search tree will be greater than the value in the node itself.

Select one:

### Question 12

Answer saved
Marked out of 1.00
Flag question

#### Question text

Which data structure is suitable to represent the hierarchal relationship between elements?

Select one:

### Question 13

Answer saved
Marked out of 1.00
Flag question

#### Question text

A stack and a queue are different names for the same ADT.

Select one:

### Question 14

Answer saved
Marked out of 1.00
Flag question

#### Question text

Which of the following is not the part of ADT description?

Select one:

### Question 15

Answer saved
Marked out of 1.00
Flag question

#### Question text

A queue displays LIFO behavior.

Select one:

### Question 16

Answer saved
Marked out of 1.00
Flag question

#### Question text

It is a pile in which items are added at one end and removed from the other.

Select one:

### Question 17

Answer saved
Marked out of 1.00
Flag question

#### Question text

Which of the following data structure can't store the non-homogeneous data elements?

Select one:

### Question 18

Answer saved
Marked out of 1.00
Flag question

#### Question text

Which data structure allows deleting data elements from and inserting at rear?

Select one:

### Question 19

Answer saved
Marked out of 1.00
Flag question

#### Question text

This is very useful in situation when data have to be stored and then retrieved in reverse order.

Select one:

### Question 20

Answer saved
Marked out of 1.00
Flag question

#### Question text

The root of a tree is the node that has no ancestors.

Select one:

### Question 21

Answer saved
Marked out of 1.00
Flag question

#### Question text

Indicate which structure would be a more suitable choice for each of the following applications.

A word processor to have a PF key that causes the preceding command to be redisplayed. Every time the PF key is pressed, the program is to show the command that preceded the one currently displayed

Select one:

### Question 22

Answer saved
Marked out of 1.00
Flag question

#### Question text

Stack is also called the ________________.

Select one:

### Question 23

Answer saved
Marked out of 1.00
Flag question

#### Question text

Indicate which structure would be a more suitable choice for each of the following applications.

A program to keep track of the soccer teams in a city tournament

Select one:

### Question 24

Answer saved
Marked out of 1.00
Flag question

#### Question text

Inserting an item into the stack when stack is not full is called ____________ while operation and deletion of item from the stack, when stack is not empty is called ________________ operation.

Select one:

### Question 25

Answer saved
Marked out of 1.00
Flag question

#### Question text

Binary search trees are ordered.

Select one:

### Question 26

Answer saved
Marked out of 1.00
Flag question

#### Question text

Indicate which structure would be a more suitable choice for each of the following applications.

A program to maintain the routes in an airline.

Select one:

### Question 27

Answer saved
Marked out of 1.00
Flag question

#### Question text

Which of the following data structure is non-linear type?

Select one:

### Question 28

Answer saved
Marked out of 1.00
Flag question

#### Question text

Which of the following data structures is linear type?

Select one:

### Question 29

Answer saved
Marked out of 1.00
Flag question

#### Question text

Indicate which structure would be a more suitable choice for each of the following applications.

An electronic address book ordered by name

Select one:

### Question 30

Answer saved
Marked out of 1.00
Flag question

#### Question text

A stack displays FIFO behavior.

Select one:

### Question 31

Answer saved
Marked out of 1.00
Flag question

#### Question text

Indicate which structure would be a more suitable choice for each of the following applications.

A program to keep track of patients as they check into a medical clinic, assigning patients to doctors on a first-come, first-served basis.

Select one:

### Question 32

Answer saved
Marked out of 1.00
Flag question

#### Question text

A binary search cannot be applied to a tree.

Select one:

### Question 33

Answer saved
Marked out of 1.00
Flag question

#### Question text

Algorithms that use a list must know whether the list is array based or linked.

Select one:

### Question 34

Answer saved
Marked out of 1.00
Flag question

#### Question text

What is written by the following algorithm?

Push(myStack, 5)
Push(myStack, 4)
Push(myStack, 4)
Pop(myStack, item)
Pop(myStack, item)
Push(myStack, item)
WHILE (NOT IsEmpty(myStack))
Pop(myStack, item)
Write item, ' '

### Question 35

Answer saved
Marked out of 1.00
Flag question

#### Question text

____________________ is not the component of data structure.

Select one:

### Question 36

Answer saved
Marked out of 1.00
Flag question

#### Question text

Which data structure is used in breadth first search of a graph to hold nodes?

Select one:

### Question 37

Answer saved
Marked out of 1.00
Flag question

#### Question text

Indicate which structure would be a more suitable choice for each of the following applications.

A bank simulation of its teller operation to see how waiting times would be affected by adding another teller.

Select one:

### Question 38

Answer saved
Marked out of 1.00
Flag question

#### Question text

What is written by the following algorithm?

Enqueue(myQueue, 5)
Enqueue(myQueue, 4)
Enqueue(myQueue, 4)
Dequeue(myQueue, item)
Dequeue(myQueue, item)
Enqueue(myQueue, item)
WHILE (NOT IsEmpty(myQueue))
Dequeue(myQueue, item)
Write item, ' '

### Question 39

Answer saved
Marked out of 1.00
Flag question

#### Question text

Which of the following is non-linear data structure?

Select one:

### Question 40

Answer saved
Marked out of 1.00
Flag question

#### Question text

Indicate which structure would be a more suitable choice for each of the following applications.

A program to keep track of family relationships

Select one:

### Question 41

Answer saved
Marked out of 1.00
Flag question

#### Question text

A binary tree is a tree in which each node can have zero, one, or two children.

Select one:

### Question 42

Answer saved
Marked out of 1.00
Flag question

#### Question text

Identify the data structure which allows deletions at both ends of the list but insertion at only one end.

Select one:

### Question 43

Answer saved
Marked out of 1.00
Flag question

#### Question text

The value in the right child of a node (if it exists) in a binary search tree will be greater than the value in the node itself.

Select one:

### Question 44

Answer saved
Marked out of 1.00
Flag question

#### Question text

Herder node is used as sentinel in __________________.

Select one:

### Question 45

Answer saved
Marked out of 1.00
Flag question

#### Question text

A binary search tree is another name for a binary tree.

Select one:

### Question 46

Answer saved
Marked out of 1.00
Flag question

#### Question text

Which of the following is/are the levels of implementation of data structure?

Select one:

### Question 47

Answer saved
Marked out of 1.00
Flag question

#### Question text

A _______________ is a data structure that organizes data similar to a line in the supermarket, where the first one in line is the first one out.

Select one:

### Question 48

Answer saved
Marked out of 1.00
Flag question

#### Question text

Indicate which structure would be a more suitable choice for each of the following applications.

A dictionary of words used by a spelling checker to be built and maintained.

Select one:

### Question 49

Answer saved
Marked out of 1.00
Flag question

#### Question text

The following algorithm is a count-controlled loop going from 1 through 5.  At each iteration, the loop counter is either printed or put on a queue depending on the result of Boolean function RanFun().  (The behavior of RanFun() is immaterial.)  At the end of the loop, the items on the queue are dequeued and printed.  Because of the logical properties of a queue, this algorithm cannot print certain sequences of the values of the loop counter.  You are given an output and asked if the algorithm could generate the output.

Set count to 0

WHILE (count < 5)

Set count to count + 1

IF (RanFun())

Write count, ' '

ELSE

Enqueue(myQueue, count)

WHILE (NOT IsEmpty(myQueue))

Dequeue(myQueue, number)

Write number, ' '

The following output is possible using a queue: 1 3 5 4 2

Select one:

### Question 50

Answer saved
Marked out of 1.00
Flag question

#### Question text

The following algorithm is a count-controlled loop going from 1 through 5.  At each iteration, the loop counter is either printed or put on a queue depending on the result of Boolean function RanFun().  (The behavior of RanFun() is immaterial.)  At the end of the loop, the items on the queue are dequeued and printed.  Because of the logical properties of a queue, this algorithm cannot print certain sequences of the values of the loop counter.  You are given an output and asked if the algorithm could generate the output.

Set count to 0

WHILE (count < 5)

Set count to count + 1

IF (RanFun())

Write count, ' '

ELSE

Enqueue(myQueue, count)

WHILE (NOT IsEmpty(myQueue))

Dequeue(myQueue, number)

Write number, ' '

The following output is possible using a queue: 1 3 5 2 4

Select one: