Final Lab Exam

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Home / My courses / UGRD-ITE6201-2323T / FINAL EXAMINATION / Final Lab Exam

Started on Friday, 5 April 2024, 8:12 AM


State Finished
Completed on Friday, 5 April 2024, 8:27 AM
Time taken 15 mins 8 secs
Marks 9.00/10.00
Grade 90.00 out of 100.00

Question 1
Correct

Mark 1.00 out of 1.00

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, ' '

Answer: 44 

Question 2
Correct

Mark 1.00 out of 1.00

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

Select one:
True 

False


Question 3

Correct

Mark 1.00 out of 1.00

A binary search cannot be applied to a tree.

Select one:
True

False 

Question 4
Correct

Mark 1.00 out of 1.00

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

Select one:
a. All of these

b. Abstract level

c. Application level

d. Implementation level

Your answer is correct.


Question 5

Incorrect

Mark 0.00 out of 1.00

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:
True 

False

Question 6

Correct

Mark 1.00 out of 1.00

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:
a. Tree

b. Queue

c. Stack

d. Binary search tree

e. Graph

Your answer is correct.


Question 7

Correct

Mark 1.00 out of 1.00

Which of the following is non-linear data structure?

Select one:
a. Trees

b. List

c. Stacks

d. Strings

Your answer is correct.

Question 8
Correct

Mark 1.00 out of 1.00

Binary search trees are ordered.

Select one:
True 

False

Question 9
Correct

Mark 1.00 out of 1.00

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

Select one:
True 

False


Question 10

Correct

Mark 1.00 out of 1.00

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

Select one:
True 

False

◄ FINAL EXAM

Jump to...

You might also like