Not Yet Answered Marked Out of 1.0

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

7/20/24, 1:01 PM Quiz 2

Question 1
Not yet answered
Marked out of 1.0

Apply Floyd algorithm to the following graph:

Which of the following statements is false?

a. abce is not shortest path from a to e.


b. In initial weighted matrix, distances from e to others are infinity.
c. We can find shortest paths from any vertex to others in this graph.
d. The shortest path from vertex a to vertex e is zero.

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 1/45
7/20/24, 1:01 PM Quiz 2

Question 2
Not yet answered
Marked out of 1.0

Use Dijkstra’s algorithm to find shortest paths from vertex C to others in the following graph:

What is “current distance of A“ after executing of the algorithm end?

a. inifinity
b. 35
c. 40
d. 0

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 2/45
7/20/24, 1:01 PM Quiz 2

Question 3
Not yet answered
Marked out of 1.0

In .................................. algorithm, each vertex v is visited and then each unvisited vertex adjacent to v is visited. If a vertex v has no
adjacent vertices or all of its adjacent vertices have been visited, we backtrack to the predecessor of v. The traversal is finished if this
visiting and backtracking process leads to the first vertex where the traversal started. If there are still some unvisited vertices in the graph,
the traversal continues restarting for one of the unvisited vertices.

a. None of the others


b. Breath First Search
c. Depth First Search

Clear my choice

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 3/45
7/20/24, 1:01 PM Quiz 2

Question 4
Not yet answered
Marked out of 1.0

Select incorrect statement about restrictions need to be imposed on the prospective codes:

a. There should not be any unused short codewords either as stand-alone encodings or as prefixes for longer codewords.
b. The length of the codeword for a given symbol A should not exceed the length of the codeword of a less probable symbol B.
c. Each codeword may be corresponds to one or many symbols.
d. Decoding should not require any look ahead.

Clear my choice

Question 5
Not yet answered
Marked out of 1.0

Which of the following is a reason why hash tables are a good choice for storing and retrieving data?

a. They are very space efficient compared to binary search trees and linked lists
b. They store data in sorted order so it is easy to find the minimum and maximum element
c. They are very fast in practice for finding items in a set

Clear my choice

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 4/45
7/20/24, 1:01 PM Quiz 2

Question 6
Not yet answered
Marked out of 1.0

Which of the following is the appropriate description of the “selection sort” algorithm?

a. The element with the smallest value is determined and swapped for the first element, and then the smallest value of the unsorted
elements is determined and swapped for the second-to-the-first element. This operation is repeated in the same way.
b. Two adjacent elements are repeatedly compared and swapped if the first element is larger than the second. This operation is
repeated until all elements are arranged in an orderly fashion.
c. An intermediate reference value is determined, and then the elements are divided into two groups of “larger” values and
“smaller”values. This operation is recursively repeated.
d. Each set of the elements extracted at regularintervals is sorted, and then the interval is further decreased. The operation is
repeatedly performed until the interval becomes 1.

Clear my choice

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 5/45
7/20/24, 1:01 PM Quiz 2

Question 7
Not yet answered
Marked out of 1.0

What is output if using LZW algorithm with the table initialized with the letters x, y, z encode the string “xyxyzxxy”?

a. 1 2 4 3 5 2
b. 4 4 3 1 1 2
c. 124314
d. 1 2 1 2 3 1 1 2

Clear my choice

Question 8
Not yet answered
Marked out of 1.0

Suppose you are doing a breadth-first search of a graph with n vertices, using a queue implemented with a static array. What is the
minimum number of elements of this array?

a. 2n
b. n + 1
c. n
d. n - 1

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 6/45
7/20/24, 1:01 PM Quiz 2

Question 9
Not yet answered
Marked out of 1.0

The best technique when the amount of data is not well known is ……

a. quadratic probing.
b. separate chaining.
c. linear probing.
d. double hashing.

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 7/45
7/20/24, 1:01 PM Quiz 2

Question 10
Not yet answered
Marked out of 1.0

Which of the following graphs looks most like the graph you (should have) produced in part 2 of the programming assignment? We are
looking for you to compare the shapes of the functions only--these graphs are much smoother than what you would have seen. Also,
ignore the specific numbers, and concentrate on the shapes and the relationship between the two lines. Note that the correct answer
assumes that you have correctly implemented your two Document classes and your DocumentBenchmarking class.
a.

b.

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 8/45
7/20/24, 1:01 PM Quiz 2

c.

d.

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 9/45
7/20/24, 1:01 PM Quiz 2

a. b
b. d
c. c
d. a

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 10/45
7/20/24, 1:01 PM Quiz 2

Question 11
Not yet answered
Marked out of 1.0

What is the worst case time complexity of linear search algorithm?

a. Ο(n^2)
b. O(logn)
c. O(1)
d. O( n )

Question 12
Not yet answered
Marked out of 1.0

What is the tightest Big-O running time to calculate the Flesch readability score in the EfficientDocument class, where n is the length of the
document, assuming you DO NOT include the time it takes to initialize the numSyllables, numWords, and numSentences variables (i.e. do not
include the time taken by processText)?

a. O(n^2)
b. O( n )
c. O(1)

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 11/45
7/20/24, 1:01 PM Quiz 2

Question 13
Not yet answered
Marked out of 1.0

A chained hash table has an array size of 512. What is the maximum number of entries that can be placed in the table?

a. 511
b. 256
c. 1024
d. 512
e. None of the others

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 12/45
7/20/24, 1:01 PM Quiz 2

Question 14
Not yet answered
Marked out of 1.0

Using the coalesced hashing to put the following values in a table with 10 elements:
A5, A2, A3, B5, A9, B2, B9, C2
Using the extraction method to extract the number as the key.
What is the chain to begin with A5?

a. A5-A2-A3
b. A5-B5-A9-B9
c. A5-B2-C2
d. A5-B5

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 13/45
7/20/24, 1:01 PM Quiz 2

Question 15
Not yet answered
Marked out of 1.0

What is the tightest Big-O running time to calculate the Flesch readability score the first time in the EfficientDocument class, where n is the
length of the document, assuming you include the time it takes to initialize the numSyllables, numWords, and numSentences variables?
Note that this is not necessarily the running time that you saw when you plotted the graph of your EfficientDocument running time when you
did your benchmarking. That time included the time to initialize the numSyllables, numWords and numSentences variables.

a. O(n^2)
b. O(1)
c. O( n )

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 14/45
7/20/24, 1:01 PM Quiz 2

Question 16
Not yet answered
Marked out of 1.0

The keys 12, 18, 13, 2, 3, 23, 5 and 15 are inserted into an initially empty hash table of length 10 using open addressing with hash function
h(k) = k mod 10 and linear probing. What is the resultant hash table?

a. A
b. D
c. C
d. B

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 15/45
7/20/24, 1:01 PM Quiz 2

Question 17
Not yet answered
Marked out of 1.0

Consider a hash table of size seven, with starting index zero, and a hash function h(x)= (3x + 4) mod 7. Assuming the hash table is initially
empty, which of the following is the contents of the table when the sequence 1, 3, 8, 10 is inserted into the table using linear probing?
Note that ‘_’ denotes an empty location in the table.

a. 1, 8, 10, _, _, _, 3
b. 8, _, _, _, _, _, 10
c. 1, 10, 8, _, _, _, 3
d. 1, _, _, _, _, _,3

Question 18
Not yet answered
Marked out of 1.0

In the algorithm for spelling suggestions in this week's assignment, there was a hash set to mark Strings as visited. What is the BEST ANSWER for
why we used the visited set?

a. To avoid exploring all the possible String mutations for an individual String more than once.
b. So that our exploration was of a tree of words, and if we had a word repeated, it wouldn't be a tree anymore.
c. To avoid testing to see if a mutated String was a real word (and hence a spelling suggestion) more than once.

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 16/45
7/20/24, 1:01 PM Quiz 2

Question 19
Not yet answered
Marked out of 1.0

In a min-heap:

a. parent nodes have values greater than or equal to their childs


b. parent nodes have values less than or equal to their childs
c. both statements are true
d. both statements are wrong

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 17/45
7/20/24, 1:01 PM Quiz 2

Question 20
Not yet answered
Marked out of 1.0

Select true / false statement in regarding to graph representation:


a. If our task is to process vertices adjacent to a vertex v, then the adjacency list requires only deg(v) steps, whereas the adjacency matrix
requires |V| steps.
b. Inserting or deleting a edge requires linked list maintenance for an adjacency list (if such an implementation is used); for a matrix, it
requires only changing 0 to 1 for insertion, or 1 to 0 for deletion, in one cell of the matrix.

a. a and b are true


b. a and b are false
c. a is false and b is true
d. a is true and b is false

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 18/45
7/20/24, 1:01 PM Quiz 2

Question 21
Not yet answered
Marked out of 1.0

Suppose that you place 180 elements in a hash table with an array size of 200. What is the load factor?

a. 0.75
b. 0.9
c. 1.45
d. 0.5

Question 22
Not yet answered
Marked out of 1.0

Quick sort algorithm is an example of

a. Improved binary search


b. Greedy approach
c. Divide and conquer
d. Dynamic Programming

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 19/45
7/20/24, 1:01 PM Quiz 2

Question 23
Not yet answered
Marked out of 1.0

You want to place 1000 elements in a hash table using linear probing, and you would like an average numbers of trials for successful
search two elements. How big does the array of hash table need to be?

a. 1500
b. 1250
c. 1000
d. 500

Question 24
Not yet answered
Marked out of 1.0

Given a raw message 'BBBUUUUBBBUUBBBBBUU' (without single quote). Run the run-length encoding algorithm for that message, what
is the output?

a. 3B4U3B2U5B
b. 3B4U3B2U5B2U
c. 3B4U4B3U2B5UU2
d. 3B4U3B2U5B2UU

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 20/45
7/20/24, 1:01 PM Quiz 2

Question 25
Not yet answered
Marked out of 1.0

When the bubble sort algorithm is used for sorting the dataset (23, 43, 56, 12, 87, 14, 87, 15, 90, 23, 10) in descending order, how many
data exchanges occur during the first iteration of outer loop?

a. 10
b. 8
c. 7
d. 9

Question 26
Not yet answered
Marked out of 1.0

What is the tightest Big-O running time to calculate the Flesch readability score for the BasicDocument class, where n is the length of the
document?

a. O(1)
b. O(n^2)
c. O(n^3)

d. O( n )

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 21/45
7/20/24, 1:01 PM Quiz 2

Question 27
Not yet answered
Marked out of 1.0

Which of the following Sorting algorithms have complexity of O( n ) in best case ?

a. Buble sort
b. All of the others.
c. Insertion sort
d. Selection sort

Question 28
Not yet answered
Marked out of 1.0

Which of the following algorithms can be used to detect cycle of a graph?

a. Union-Find
b. Depth First Traversal
c. Graph coloring
d. Minimum Spanning Tree

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 22/45
7/20/24, 1:01 PM Quiz 2

Question 29
Not yet answered
Marked out of 1.0

Consider the list of eight integers below: 6, 4, 9, 10, 8, 3, 7, 5


What is the list after it has just been partitioned by the first step of quicksort and a pivot value is chosen as the first element of the list?
(sorting from smallest to largest). Assume that selecting largest element of the array is ignored.

a. 3, 4, 6, 5, 8, 10, 7, 9
b. 3, 4, 5, 6, 8, 7, 9, 10
c. 3, 4, 5, 6, 8, 10, 7, 9
d. 3, 4, 5, 6, 7, 8, 10, 9

Question 30
Not yet answered
Marked out of 1.0

Which of the following statements about the shortest path finding algorithm of Dijkstra is true?

a. It is label-setting algorithm.
b. It can be applied to graphs have negative weights.
c. It's complexity is O(|V|), where |V| is number of vertices of the graph.
d. All of the others.

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 23/45
7/20/24, 1:01 PM Quiz 2

Question 31
Not yet answered
Marked out of 1.0

Select incorrect statements about the shortest path algorithm:

a. Dijkstra’s algorithm cannot be applied to undirected weighted graphs.


b. Dijkstra’s algorithm finds the shortest path from one specified vertex to all other vertices.
c. Dijkstra’s algorithm is sort of label-setting.
d. Dijkstra’s algorithm is used to graphs which have positive weight.

Question 32
Not yet answered
Marked out of 1.0

In your benchmarking of the DictionaryBST structure, you probably found that the time to find words did not significantly increase as the
Dictionary got larger. Which of the following is the most likely reason for this behavior?

a. We were measuring the best case performance of the dictionary, which does not change as the dictionary size grows.
b. log( n ) is sufficiently small and grows sufficiently slowly that other factors (e.g. memory use) had a bigger effect on the running time
than the size to find the word in the dictionary.

c. The running time to find an element in a balanced BST is O(1) so we would not expect the running time to get larger as the dictionary
got bigger.

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 24/45
7/20/24, 1:01 PM Quiz 2

Question 33
Not yet answered
Marked out of 1.0

An array contains the elements shown below:


7 8 26 44 13 23 98 57
What would be the value of the elements in the array after two pass of the heap sort algorithm.

a. 26 13 23 7 8 44 57 98
b. 57 26 44 7 13 8 23 98
c. 44 26 23 7 13 8 57 98
d. 7 8 13 23 26 44 57 98

Question 34
Not yet answered
Marked out of 1.0

Which of the following is true of searching for an element in a Hash Table that is implemented using linear probing (you may assume a Hash
Table that is ~70% full)?

a. Average case is O(1)


b. Worst case is O(1)
c. Average case is log( n )

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 25/45
7/20/24, 1:01 PM Quiz 2

Question 35
Not yet answered
Marked out of 1.0

What data structure can be used to check if a syntax has balanced paranthesis ?

a. list
b. queue
c. tree
d. stack

Question 36
Not yet answered
Marked out of 1.0

What is the best definition of a collision situation in a hash table?

a. Two entries are identical except for their keys.


b. Two entries with different data have the exact same key.
c. Two entries with different keys have the same exact hash value.
d. Two entries with the exact same key have different hash values.

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 26/45
7/20/24, 1:01 PM Quiz 2

Question 37
Not yet answered
Marked out of 1.0

Find the average length LHuf for the letters X, Y, and Z and their probabilities .05, .05 and .9 respectively.

a. 1.75
b. 2.3
c. None of the others.
d. 1.1
e. 0.8

Question 38
Not yet answered
Marked out of 1.0

Encoding the string "aaabbccddddddeee" with Huffman. Please indicate the size of the output string?

a. 36 bits
b. 16 bits
c. 24 bits
d. 128 bits

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 27/45
7/20/24, 1:01 PM Quiz 2

Question 39
Not yet answered
Marked out of 1.0

Use Dijkstra’s algorithm to find shortest paths from vertex A to others in the following graph:

Which vertex is chosen in iteration 4 of the algorithm?

a. D
b. C
c. F
d. E

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 28/45
7/20/24, 1:01 PM Quiz 2

Question 40
Not yet answered
Marked out of 1.0

Select correct statement:

a. If there are N items, the bubble sort makes exactly N*N comparisons.
b. The bubble sort always ends up comparing every item with every other item.
c. A copy is three times as fast as a swap.
d. In a particular sorting situation, if swaps take much longer than comparisons, the selection sort is about twice as fast as the
bubble sort.

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 29/45
7/20/24, 1:01 PM Quiz 2

Question 41
Not yet answered
Marked out of 1.0

Select true / false statement in regarding to graph representation:


a. There are n possible adjacency matrices for the same graph.
b. Multigraphs can be represented in the following adjacency matrix:
aij = number of edges between vi and vj

a. a and b are false


b. a is true and b is false
c. a and b are true

d. a is false and b is true

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 30/45
7/20/24, 1:01 PM Quiz 2

Question 42
Not yet answered
Marked out of 1.0

Maximum number of nodes in a binary tree with height k, where root is height 0, is

a. (2^k) -1
b. (2^(k+1)) -1
c. (2^k) +1
d. (2^(k-1)) -1

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 31/45
7/20/24, 1:01 PM Quiz 2

Question 43
Not yet answered
Marked out of 1.0

A hash table of length 10 uses open addressing with hash function h(k)=k mod 10, and linear probing. After inserting 6 values into an
empty hash table, the table is
as shown below.

Which one of the following choices gives a possible order in which the key values could have been inserted in the table? (Assume that
Linear probing was used to resolved collision)

a. 34, 42, 23, 52, 33, 46


b. 42, 46, 33, 23, 34, 52
c. 46, 34, 42, 23, 52, 33
d. 46, 42, 34, 52, 23, 33

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 32/45
7/20/24, 1:01 PM Quiz 2

Question 44
Not yet answered
Marked out of 1.0

Which of the following Sorting algorithms use Divide and Conquer strategy?

a. Radix sort
b. Bubble sort
c. Heap sort
d. Quick sort

Question 45
Not yet answered
Marked out of 1.0

Which of the following data structures does not suitable for implementing Huffman algorithm?

a. Singly linked list.


b. Heap.
c. Doubly linked list.
d. Queue.

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 33/45
7/20/24, 1:01 PM Quiz 2

Question 46
Not yet answered
Marked out of 1.0

After two passes of a sort algorithm, the following array:


47 3 21 32 56 92
has been rearranged as shown below:
3 21 47 32 56 92
Which sorting algorithm is being used?

a. bubble sort.
b. insertion sort.
c. all of them.
d. selection sort.

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 34/45
7/20/24, 1:01 PM Quiz 2

Question 47
Not yet answered
Marked out of 1.0

Which of the following data structures are the most suites for handling the minimum (maximum) weighted distances?

a. Queue
b. Linked list
c. Stack
d. Priority Queue

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 35/45
7/20/24, 1:01 PM Quiz 2

Question 48
Not yet answered
Marked out of 1.0

Apply Kruskal's Minimum Spanning Tree (MST) to the following graph:

Select false statement:

a. bc is not added to MST because it forms a cycle with ac and ac.


b. The algorithm have consideration to edges be, de and cd but does not add them to MST.
c. cf is the latest edge added to MST.

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 36/45
7/20/24, 1:01 PM Quiz 2

Question 49
Not yet answered
Marked out of 1.0

Given the character frequencies


B : 32%
C : 28%
D : 16%
E : 6%
F : 18%
Using Huffman encoding, what is the code for character D? (Suppose that when constructing a sub tree from 2 nodes we always place
node with higher frequency on the left; and the left branch of a node gets value 0, the right one gets value 1)

a. 101
b. 001
c. 01
d. 100

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 37/45
7/20/24, 1:01 PM Quiz 2

Question 50
Not yet answered
Marked out of 1.0

The “prime number division remainder” method is a well-known hashing algorithm. In this method, a key value is divided by a number N,
and the remainder which is also called a hash value is used directly as an index into the hash table. N is the largest prime number less
than or equal to the size of the table. When the table size is 20, which of the following is the correct hash value calculated from the key
value 136? Here, a prime number is one that cannot be divided evenly by any other number except one (1). 2, 3, 5, 7, 11, and 13 are the
first few prime numbers.

a. None of the others.


b. 16
c. 0
d. 1
e. 3

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 38/45
7/20/24, 1:01 PM Quiz 2

Question 51
Not yet answered
Marked out of 1.0

In order to sort the sequence “98, 12, 4, 56, 34, 23” in ascending order by Bubble Sort algorithm, how many exchange operations are
required?

a. 9
b. 5
c. 7
d. 11

Question 52
Not yet answered
Marked out of 1.0

What is output if using LZW algorithm with the table initialized with the letters a, b, c encode the string “ababcaab”?

a. 1 2 1 2 3 1 1 2
b. 4 4 3 1 1 2
c. 124352
d. 1 2 4 3 1 4

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 39/45
7/20/24, 1:01 PM Quiz 2

Question 53
Not yet answered
Marked out of 1.0

Which of the following algorithms in graphs can be implemented by extending Depth First Search algorithm?

a. All of the others.


b. The Chinese Postman Tour
c. Finding the shortest path (Dijkstra algorithm)
d. Cycle detection.

Question 54
Not yet answered
Marked out of 1.0

In run-length encoding algorithm, a run is defined as …

a. a sequence of identical characters.


b. number of different characters in the input.
c. size of the result of encoding input data.
d. amount of time required to the compression algorithm.

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 40/45
7/20/24, 1:01 PM Quiz 2

Question 55
Not yet answered
Marked out of 1.0

Select incorrect statement about Adaptive Huffman Coding:

a. The sibling property is described as each node has a sibling (except for the root) and the breadth-first right-to-left tree traversal
generates a list of nodes with nonincreasing frequency counters.
b. If the sibling property is violated, Huffman tree has to be restructured to restore this property.
c. If Adaptive Huffman coding is used to compress execute file, output file is much smaller than the original.
d. Adaptive Huffman coding can be applied to any kind of file.

Question 56
Not yet answered
Marked out of 1.0

In a weighted graph, the minimum spanning tree tries to minimize ………..

a. the total weight of edges connecting all the vertices.


b. the number of edges connecting all the vertices.
c. the number of edges from the starting vertex to a specified vertex.
d. the total weight of the edges from the starting vertex to a specified vertex.

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 41/45
7/20/24, 1:01 PM Quiz 2

Question 57
Not yet answered
Marked out of 1.0

Which the sorting technique always makes recursive calls to sort pieces that are about half the size of the original array?

a. Merge sort.
b. Heap sort.
c. Radix sort.
d. Quick sort.

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 42/45
7/20/24, 1:01 PM Quiz 2

Question 58
Not yet answered
Marked out of 1.0

Use Dijkstra’s algorithm to find shortest paths from vertex A to others in the following graph:

What is “current distance of F“ after iteration 3 of the algorithm?

a. infinity
b. 70
c. 95
d. 20

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 43/45
7/20/24, 1:01 PM Quiz 2

Question 59
Not yet answered
Marked out of 1.0

Does a higher or lower Flesch Index Score indicate simpler text?

a. The lower the Flesch Index Score, the simpler the text and the easier it is to read.
b. The higher the Flesch Index Score, the simpler the text and the easier it is to read.

Question 60
Not yet answered
Marked out of 1.0

When a hash table becomes too full, which of the following is required to resize the table?

a. Create a new table which is larger than the original table. Then individually reinsert each key from the old table into the new table (i.e. if
a key is in location X in the original table, it may or may not be in position X in the new table).

b. Create a new table which is larger than the original table. Then bulk copy keys from one table to the other (i.e. if a key is in location X in
the original table, it remains in position X in the new table).

c. Add extra space at the end of the existing hash table and leave the old keys in place.

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 44/45
7/20/24, 1:01 PM Quiz 2

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=949036&cmid=44309 45/45

You might also like