Comparative Programming Languages Quiz

Top of Form
An important advantage of the sequential tree implementation is that (select the best answer):
Select one:
a. It is an extremely shallow tree
b. The data structure can be transmitted between computers
c. It saves space because no pointers are stored
d. It uses dynamic nodes
Feedback
The correct answer is: It saves space because no pointers are stored
Question 2
Correct
Mark 1.00 out of 1.00
Flag question
Question text
A solution is said to be efficient if it:
Select one:
a. Solves the problem within the required resource constraints
b. Executes faster than other solutions
c. Is completed in the fewest number of steps
d. Can be explained in the context of Big-Oh notation
Feedback
The correct answer is: Solves the problem within the required resource constraints
Question 3
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Asymptotic Algorithm Analysis is primarily concerned with:
Select one:
a. The size of the constant in the algorithm running time equation
b. The speed of the computing running the algorithm
c. The speed of the compiler
d. The growth rate demonstrated in the algorithm running time equation
Feedback
The correct answer is: The growth rate demonstrated in the algorithm running time equation
Question 4
Correct
Mark 1.00 out of 1.00
Flag question
Question text
For the following code fragment, select the option which represents the most appropriate asymptotic analysis:
/** @return Position of largest value in "A“ */
static int largest(int[] A) {
int currlarge = 0; // Position of largest
for (int i=1; i<A.length; i++)
if (A[currlarge] < A[i])
currlarge = i; // Remember pos
return currlarge; // Return largest pos
}

Choice 1. Θ ( n )
Choice 2. O( 2n )
Choice 3. Θ( n log n )
Choice 4. Ω( n2 )
(NOTE: code fragment is not intended to be functioning code)

Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 1
Question 5
Correct
Mark 1.00 out of 1.00
Flag question
Question text
The process of determining if two objects are in the same set and then merging those sets is called:
Select one:
a. a Union Operation
b. Union / Find
c. a Weighted Union
d. a Merge Operation
Feedback
The correct answer is: Union / Find
Question 6
Correct
Mark 1.00 out of 1.00
Flag question
Question text
A sequential tree can be represented using a bit vector?
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 7
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Enqueue and Dequeue are notations associated with which data structure:
Select one:
a. Queue
b. Stack
c. List
d. Array
Feedback
The correct answer is: Queue
Question 8
Correct
Mark 1.00 out of 1.00
Flag question
Question text
True/False: The stack data structure is implemented as a LIFO structure (last in first out)
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 9
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Correctly identify the following heap structure by selecting the best answer:

Select one:
a. partially ordered heap
b. max-heap structure
c. priority heap
d. min-heap structure
Feedback
The correct answer is: max-heap structure
Question 10
Correct
Mark 1.00 out of 1.00
Flag question
Question text
True/False: Big Theta (Θ) indicates that the Upper and Lower bounds of an algorithm are the same.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 11
Correct
Mark 1.00 out of 1.00
Flag question
Question text
A finite set of one or more nodes such that there is one designated node call the root is a: (select the best answer)
Select one:
a. Parent root
b. a B+ tree data structure
c. Index
d. Tree
Feedback
The correct answer is: Tree
Question 12
Correct
Mark 1.00 out of 1.00
Flag question
Question text
If A={1, 2, 3, 4} and B={4, 5, 6}, find A∪ B .
Select one:
a. {1,2,3,4,4,5,6}
b. {4}
c. {x | x is all positive integers}
d. {1,2,3,4,5,6}
Feedback
The correct answer is: {1,2,3,4,5,6}
Question 13
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select the answer that best defines Huffman Coding:
Select one:
a. A set of coding rules that is typically used for compression
b. A fixed length coding scheme for character representation
c. A tree structure that trades off space and time requirements to provide a more efficient priority queue
d. An approach of assigning codes to characters such that the frequency length of the code depends upon the relative frequency of the corresponding character in use
Feedback
The correct answer is: An approach of assigning codes to characters such that the frequency length of the code depends upon the relative frequency of the corresponding character in use
Question 14
Correct
Mark 1.00 out of 1.00
Flag question
Question text
A leaf is any node that:
Select one:
a. Has one child
b. Is an internal node with no ancestors
c. Is any node with two empty children
d. Is the ancestor of the root node
Feedback
The correct answer is: Is any node with two empty children
Question 15
Correct
Mark 1.00 out of 1.00
Flag question
Question text
A linked list implementation relies upon static memory allocation where static refers to the requirement to pre-allocate all of the memory that will be used for the list.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 16
Correct
Mark 1.00 out of 1.00
Flag question
Question text
For the following code fragment, select the option that represents the most appropriate asymptotic analysis:
for (int i = 1; i <= n; i *= 2) {
for (int j = 0; j < n; j++) {
count++;
}
}
Option 1. O( 1 )
Option 2. O( 2n )
Option 3. O( n log n )
Option 4. O( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
Explanation: Here the outer loop is done log n times and the inner loop is done n times, so T(n) = n log n. (Note that the default base for logarithms in Computer Science is 2.)
The correct answer is: Option 3
Question 17
Correct
Mark 1.00 out of 1.00
Flag question
Question text
In linked lists there are no NULL links in:
Select one:
a. Single linked list
b. Linear doubly linked list
c. Circular linked list
d. None of these
Feedback
The correct answer is: Circular linked list
Question 18
Correct
Mark 1.00 out of 1.00
Flag question
Question text
True/False: Big Theta (Θ) indicates that the Upper and Lower bounds of an algorithm are the same.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 19
Incorrect
Mark 0.00 out of 1.00
Flag question
Question text
A list is said to be empty when all of its elements have a zero (0) value
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 20
Correct
Mark 1.00 out of 1.00
Flag question
Question text
A full binary tree has a restricted shape which starts at the root and fills the tree by levels from left to right.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 21
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Which of the following is NOT one of the design patterns outlined in our text.
Select one:
a. Flyweight
b. Visitor
c. Composite
d. Synergy
Feedback
The correct answer is: Synergy
Question 22
Correct
Mark 1.00 out of 1.00
Flag question
Question text
The upper bound for the growth of the Algorithms running time is represented by (please select the best answer):
1. Big Oh (O)
2. Big Omega (Ω)
3. Big Theta (Θ)
4. Exponential growth
Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 1
Question 23
Correct
Mark 1.00 out of 1.00
Flag question
Question text
The most time consuming of the following operations on an array based list implementation is:
Select one:
a. Inserting a new element at position n-1 in the list where n is the number of elements in the list.
b. Inserting a new element into the head of the list.
c. Removing an element at position n-1 within the list
d. Removing an element from the tail of the list.
Feedback
The correct answer is: Inserting a new element into the head of the list.
Question 24
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Which of the following is not a characteristic of an algorithm?
Select one:
a. It must be correct
b. It must be composed of concrete steps
c. It can have no ambiguity
d. It must be composed of an infinite number of steps.
Feedback
The correct answer is: It must be composed of an infinite number of steps.
Question 25
Correct
Mark 1.00 out of 1.00
Flag question
Question text
For the following code fragment, select the most appropriate asymptotic analysis:
// Towers of Hanoi
static void solveHanoi(int disks, char fromPole, char toPole, char withPole) {
if (disks >= 1) {
solveHanoi(disks-1, fromPole, withPole, toPole);
moveDisk(fromPole, toPole);
solveHanoi(disks-1, withPole, toPole, fromPole);
}
}
static void moveDisk(char fromPole, char toPole) {
moves++;
}
Option 1. O( n )
Option 2. O( 2n )
Option 3. O( n log n )
Option 4. O( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
The correct answer is: Option 2
Bottom of Form


For the following code fragment, select the option that represents the most appropriate asymptotic analysis:
for (int i = 0; i < a.length; i++) {
System.out.println(a[i]);
}
Option 1. O( n )
Option 2. O( 2n )
Option 3. O( n log n )
Option 4. O( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
The correct answer is: Option 1
Question 2
Not answered
Marked out of 1.00
Flag question
Question text
The weighted union rule joins a tree with fewer nodes to a tree with more nodes by making the smaller tree’s root point to the root of the larger tree.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 3
Not answered
Marked out of 1.00
Flag question
Question text
The depth of node H in the following tree is:

Select one:
a. 3
b. 2
c. 4
d. 1
Feedback
The correct answer is: 3
Question 4
Not answered
Marked out of 1.00
Flag question
Question text
The most significant difference between the B+-Tree and the BST is that the B+-Tree stores records only at the leaf nodes.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 5
Not answered
Marked out of 1.00
Flag question
Question text
True/False: Big Theta (Θ) indicates that the Upper and Lower bounds of an algorithm are the same.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 6
Not answered
Marked out of 1.00
Flag question
Question text
The quicksort is typically slower than the heapsort by a constant factor.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 7
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
static int function ( n ) {
sum = 0;
for (i=1; i<=n; i++)
sum += n;
return sum;
}
Choice 1. Ω( n2 )
Choice 2. Ω( log n2 )
Choice 3. Θ( n log n )
Choice 4. O ( n )
(NOTE: code fragment is not intended to be functioning code)



Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 4
Question 8
Not answered
Marked out of 1.00
Flag question
Question text
A compound computed search that combines a binary search to get close to the required record and then uses sequential search to find the item is referred to as a/an:
Select one:
a. Zipf search
b. An Exact match search
c. A Dictionary search
d. bit map vector search
Feedback
The correct answer is: A Dictionary search
Question 9
Not answered
Marked out of 1.00
Flag question
Question text
The process for visiting all of the nodes of a binary tree in some order is called a traversal.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 10
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
function ( n ) {
sum2 = 0;
for (k=1; k<=n; k*=2)
for (j=1; j<=k; j++)
sum2++;
}
Choice 1. O( 2n )
Choice 2. Θ ( n )
Choice 3. Θ( n log n )
Choice 4. Ω( n2 )
(NOTE: code fragment is not intended to be functioning code)

Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 2
Question 11
Not answered
Marked out of 1.00
Flag question
Question text
A linked list creates order through the use of pointers that link one element to another.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 12
Not answered
Marked out of 1.00
Flag question
Question text
Inserting or removing an item at position n-1 within a linked list has the same cost in terms  ( n ) time as the same operation in an array based implementation of a list.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 13
Not answered
Marked out of 1.00
Flag question
Question text
Select the answer that best defines Huffman Coding:
Select one:
a. A set of coding rules that is typically used for compression
b. A fixed length coding scheme for character representation
c. A tree structure that trades off space and time requirements to provide a more efficient priority queue
d. An approach of assigning codes to characters such that the frequency length of the code depends upon the relative frequency of the corresponding character in use
Feedback
The correct answer is: An approach of assigning codes to characters such that the frequency length of the code depends upon the relative frequency of the corresponding character in use
Question 14
Not answered
Marked out of 1.00
Flag question
Question text
A tree data structure whose shape obeys the following definition,
o A node contains one or two keys
o Every internal node has either 2 children if it contains 1 key or 3 children if it contains two keys
o All leaves are at the same level in the tree
Is called a/an:
Select one:
a. B*-Tree
b. BST
c. B+-Tree
d. 2-3 tree
Feedback
The correct answer is: 2-3 tree
Question 15
Not answered
Marked out of 1.00
Flag question
Question text
Data is stored within the disk drive on the: (select the best answer)
Select one:
a. Spindle
b. Platter
c. Cylinder
d. Sector
Feedback
The correct answer is: Platter
Question 16
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the most appropriate asymptotic analysis:
// Towers of Hanoi
static void solveHanoi(int disks, char fromPole, char toPole, char withPole) {
if (disks >= 1) {
solveHanoi(disks-1, fromPole, withPole, toPole);
moveDisk(fromPole, toPole);
solveHanoi(disks-1, withPole, toPole, fromPole);
}
}
static void moveDisk(char fromPole, char toPole) {
moves++;
}
Option 1. O( n )
Option 2. O( 2n )
Option 3. O( n log n )
Option 4. O( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
The correct answer is: Option 2
Question 17
Not answered
Marked out of 1.00
Flag question
Question text
The full binary tree theorem states “the number of leaves in an empty full binary tree is one more than the number of internal nodes”
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 18
Not answered
Marked out of 1.00
Flag question
Question text
A full binary tree has a restricted shape which starts at the root and fills the tree by levels from left to right.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 19
Not answered
Marked out of 1.00
Flag question
Question text
A list that organizes the order of records within the list based upon patterns of actual record access is called a/an (select the best answer):
Select one:
a. Quadratic Binary search order
b. A Zipf Distribution
c. A Self-organizing list
d. A range query
Feedback
The correct answer is: A Self-organizing list
Question 20
Not answered
Marked out of 1.00
Flag question
Question text
An exchange sort is one where: (select the best answer)
Select one:
a. Records in an unsorted list are moved to a sorted list
b. Adjacent records in the list and compared and exchanged
c. An inversion is executed
d. The sorting algorithm is said to be stable
Feedback
The correct answer is: Adjacent records in the list and compared and exchanged
Question 21
Not answered
Marked out of 1.00
Flag question
Question text
An algorithm that breaks a file to be sorted in smaller files called runs which are sorted and eventually put back together resulting in a sorted file is called:
Select one:
a. Quicksort algorithm
b. Replacement sort algorithm
c. An indexed key sort algorithm
d. Mergesort algorithm
Feedback
The correct answer is: Mergesort algorithm
Question 22
Not answered
Marked out of 1.00
Flag question
Question text
The lower bound for the growth of the Algorithms running time is represented by (please the best answer):
1. Big Oh (O)
2. Big Omega (Ω)
3. Big Theta (Θ)
4. Exponential growth
Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 2
Question 23
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
function ( n ) {
sum1 = 0;
for (i=1; i<=n; i++)
for (j=1; j<=n; j++)
sum1++;
}
Choice 1. Θ ( n2 )
Choice 2. O( 2n )
Choice 3. Θ( n log n )
Choice 4. Ω( log n2 )
(NOTE: code fragment is not intended to be functioning code)

Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 1
Question 24
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
static int function ( n ) {
for (k=0; k<n; k++)
A[k] = k;
return A[k];
}
Choice 1. O ( n2 )
Choice 2. O( 2n )
Choice 3. Ω( n2 )
Choice 4. Θ ( n )
(NOTE: code fragment is not intended to be functioning code)

Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 4
Question 25
Not answered
Marked out of 1.00
Flag question
Question text
A technique that allows a programmer to use more main memory than exists in the computer is called: (select the best answer)
Select one:
a. Buffer cache
b. Random access memory
c. Secondary storage
d. Virtual memory
Feedback
The correct answer is: Virtual memory
Question 26
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the option that represents the most appropriate asymptotic analysis:
public static int binarySearch(int[] a, int key) {
int left = 0;
int right = a.length-1;
while (left <= right) {
int mid = left + (right-left)/2;
if (key < a[mid]) right = mid-1;
else if (key > a[mid]) left = mid+1;
else return mid;
}
//not found
return -1;
}
Option 1. Ω( 1 ), O( log n )
Option 2. Ω( n ), O( 2n )
Option 3. Θ( n log n )
Option 4. Θ( log n )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
The correct answer is: Option 1
Question 27
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
static int function ( n ) {
for (k=0; k<n; k++)
A[k] = k;
return A[k];
}
Choice 1. Θ ( n log n )
Choice 2. O( 2n )
Choice 3. O( n )
Choice 4. Ω( n2 )
(NOTE: code fragment is not intended to be functioning code)



Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 3
Question 28
Not answered
Marked out of 1.00
Flag question
Question text
A list is
Select one:
a. An ADT for storing and retrieving data
b. A tree data structure
c. Finite ordered sequence of data items
d. A collection of operations to implement an ADT
Feedback
The correct answer is: Finite ordered sequence of data items
Question 29
Not answered
Marked out of 1.00
Flag question
Question text
Internal Fragmentation refers to: (select the best answer)
Select one:
a. Space that is left empty because records do not fit evenly into a sector
b. Space allocated to a file that is not physically adjacent on the disk drive
c. Space that is left empty because records do not fit evenly into a sector or Space allocated to a file that is not physically adjacent
d. None of the options
Feedback
The correct answer is: Space that is left empty because records do not fit evenly into a sector or Space allocated to a file that is not physically adjacent
Question 30
Not answered
Marked out of 1.00
Flag question
Question text
The best asymptotic analysis for the selection sort is represented by (select the best option):
Option 1. O( n log n )
Option 2. Ω( n2 )
Option 3. O( n2 )
Option 4. Θ( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
The correct answer is: Option 4
Question 31
Not answered
Marked out of 1.00
Flag question
Question text
Each record of a database normally has a unique identifier called the:
Select one:
a. Secondary Key
b. Primary index
c. Primary key
d. Index key
Feedback
The correct answer is: Primary key
Question 32
Not answered
Marked out of 1.00
Flag question
Question text
True/False: The queue data structure is implemented as FIFO structure (first in first out)
:
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 33
Not answered
Marked out of 1.00
Flag question
Question text
The benefit of a quicksort is that it provides excellent performance in both the average and worst case:
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 34
Not answered
Marked out of 1.00
Flag question
Question text
Setting the dirty bit causes what action to be performed on a block: (select the best answer)
Select one:
a. It is deleted because it is no longer consistent
b. It flushes or writes the block out to the disk
c. Refreshes the data by re-reading the block
d. It cleans the cache by flushing all data from the cache
Feedback
The correct answer is: It flushes or writes the block out to the disk
Question 35
Not answered
Marked out of 1.00
Flag question
Question text
According to the properties of logarithms, log(nm) =
Note: Due to issues with HTML formatting, an exponent is represented by preceding it with the ^ symbol. As such x^2 is equivalent to x2.
Select one:
a. log n – log m
b. n log n
c. log n + log m
d. log(n^m)
Feedback
The correct answer is: log n + log m
Question 36
Not answered
Marked out of 1.00
Flag question
Question text
A sorting algorithm that assigns records to bins and then relies on some other sorting technique to sort the records within each bin called:
Select one:
a. Radix Sort
b. Quicksort
c. Hash sort
d. Bucket sort
Feedback
The correct answer is: Bucket sort
Question 37
Not answered
Marked out of 1.00
Flag question
Question text
The upper bound for the growth of the Algorithms running time is represented by (please select the best answer):
1. Big Oh (O)
2. Big Omega (Ω)
3. Big Theta (Θ)
4. Exponential growth
Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 1
Question 38
Not answered
Marked out of 1.00
Flag question
Question text
In linked lists there are no NULL links in:
Select one:
a. Single linked list
b. Linear doubly linked list
c. Circular linked list
d. None of these
Feedback
The correct answer is: Circular linked list
Question 39
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the option that represents the most appropriate asymptotic analysis:
for (int i = 1; i <= n; i *= 2) {
for (int j = 0; j < n; j++) {
count++;
}
}
Option 1. O( 1 )
Option 2. O( 2n )
Option 3. O( n log n )
Option 4. O( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
Explanation: Here the outer loop is done log n times and the inner loop is done n times, so T(n) = n log n. (Note that the default base for logarithms in Computer Science is 2.)
The correct answer is: Option 3
Question 40
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
static int function ( n ) {
sum = 0;
for (j=1; j<=n; j++)
for (i=1; i<=j; i++)
sum++;
return sum;
}
Choice 1. Θ ( n )
Choice 2. O( 2n )
Choice 3. Θ( n2 )
Choice 4. Ω( n2 )
(NOTE: code fragment is not intended to be functioning code)


Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 3
Question 41
Not answered
Marked out of 1.00
Flag question
Question text
The upper bound for the growth of the Algorithms running time is represented by:
Select one:
a. Big Oh (O)
b. Big Omega (Ω)
c. Big Theta (Θ)
d. Exponential growth
Feedback
The correct answer is: Big Oh (O)
Question 42
Not answered
Marked out of 1.00
Flag question
Question text
Which of the following is NOT one of the design patterns outlined in our text.
Select one:
a. Flyweight
b. Visitor
c. Composite
d. Synergy
Feedback
The correct answer is: Synergy
Question 43
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
function ( n ) {
sum1 = 0;
for (k=1; k<=n; k*=2)
for (j=1; j<=n; j++)
sum1++;
}
Choice 1. Θ ( n )
Choice 2. O( 2n )
Choice 3. Θ( n log n )
Choice 4. Ω( n2 )
(NOTE: code fragment is not intended to be functioning code)

Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 3
Question 44
Not answered
Marked out of 1.00
Flag question
Question text
When big-Oh and  coincide, we indicate this by using (select the best answer):
1. Big Oh (O)
2. Big Omega (Ω)
3. Big Theta (Θ)
4. Exponential growth
Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 3
Question 45
Not answered
Marked out of 1.00
Flag question
Question text
A traversal that visits the left subtree, then the node, and then the right subtree is called:

Select one:
a. Preorder Traversal
b. Postorder Traversal
c. Inorder Traversal
d. Outoforder Traversal
Feedback
The correct answer is: Inorder Traversal
Question 46
Not answered
Marked out of 1.00
Flag question
Question text
A sequential tree can be represented using a bit vector?
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 47
Not answered
Marked out of 1.00
Flag question
Question text
A list is said to be empty when all of its elements have a zero (0) value
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 48
Not answered
Marked out of 1.00
Flag question
Question text
A sort algorithm that uses two nested loops with the inner loop moving through the array from bottom to top is called the:
Select one:
a. Insertion sort
b. Bubble sort
c. Inversion sort
d. Selection sort
Feedback
The correct answer is: Bubble sort
Question 49
Not answered
Marked out of 1.00
Flag question
Question text
Which of the following is not a characteristic of an algorithm?
Select one:
a. It must be correct
b. It must be composed of concrete steps
c. It can have no ambiguity
d. It must be composed of an infinite number of steps.
Feedback
The correct answer is: It must be composed of an infinite number of steps.
Question 50
Not answered
Marked out of 1.00
Flag question
Question text
Which of the following is not a mathematical proof technique?
Select one:
a. Proof by mathematical induction
b. Proof by contradiction
c. Direct proof
d. Proof by consensus
Feedback
The correct answer is: Proof by consensus
Question 51
Not answered
Marked out of 1.00
Flag question
Question text
True/False: Big Theta (Θ) indicates that the Upper and Lower bounds of an algorithm are the same.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 52
Not answered
Marked out of 1.00
Flag question
Question text
A collection of one or more trees is called:
Select one:
a. Trees
b. Multiple Spanning Trees
c. a Forest
d. Traversals
Feedback
The correct answer is: a Forest
Question 53
Not answered
Marked out of 1.00
Flag question
Question text
The most time consuming of the following operations on an array based list implementation is:
Select one:
a. Inserting a new element at position n-1 in the list where n is the number of elements in the list.
b. Inserting a new element into the head of the list.
c. Removing an element at position n-1 within the list
d. Removing an element from the tail of the list.
Feedback
The correct answer is: Inserting a new element into the head of the list.
Question 54
Not answered
Marked out of 1.00
Flag question
Question text
In a queue, placing new items in the queue is referred to as a push and taking an item out of the queue is called a pop.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 55
Not answered
Marked out of 1.00
Flag question
Question text
A method that is designed to create extremely shallow trees is called:
Select one:
a. Dynamic node implementation
b. Union/Find
c. The list of children method
d. Path compression
Feedback
The correct answer is: Path compression
Question 56
Not answered
Marked out of 1.00
Flag question
Question text
Correctly identify the following heap structure by selecting the best answer:

Select one:
a. partially ordered heap
b. max-heap structure
c. priority heap
d. min-heap structure
Feedback
The correct answer is: max-heap structure
Question 57
Not answered
Marked out of 1.00
Flag question
Question text
True/False: There is always one most efficient algorithm to solve a particular problem.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 58
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the option that represents the most appropriate asymptotic analysis:
if (a.length > 0) {
return a[a.length - 1];
} else {
throw new NoSuchElementException();
}
Option 1. O( 1 )
Option 2. O( 2n )
Option 3. O( n log n )
Option 4. O( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
Explanation: Here n = a.length, and T(n) = 1.
The correct answer is: Option 1
Question 59
Not answered
Marked out of 1.00
Flag question
Question text
An ADT is:
Select one:
a. A type together with a collection of operations to manipulate the type
b. An implementation of a flyweight design pattern
c. The realization of a data type as a software component
d. An implementation in java of a class for a data type
Feedback
The correct answer is: The realization of a data type as a software component
Question 60
Not answered
Marked out of 1.00
Flag question
Question text
Which of the following is not one of the general approaches to search algorithms:
Select one:
a. Buffer cache access methods
b. Sequential and list methods
c. Direct access by key value (hashing)
d. Tree indexing methods
Feedback
The correct answer is: Buffer cache access methods
Question 61
Not answered
Marked out of 1.00
Flag question
Question text
A preorder traversal visits every node starting at the leaf nodes and working up the tree.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 62
Not answered
Marked out of 1.00
Flag question
Question text
A tree whose internal nodes all have exactly K children is called a K-ary tree.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 63
Not answered
Marked out of 1.00
Flag question
Question text
According to textbook by Shaffer, a heap data structure has two properties which are:
Select one:
a. every node stores a value less than or equal to that of its children and it is a complete binary tree
b. it is a min-heap and is partially ordered
c. it is a complete binary tree and the values stored in it are partially ordered
d. it is a priority queue and is in Θ( n )
Feedback
The correct answer is: it is a complete binary tree and the values stored in it are partially ordered
Question 64
Not answered
Marked out of 1.00
Flag question
Question text
A traversal that visits each node before visiting its children is called:
Select one:
a. Preorder traversal
b. Postorder traversal
c. Inorder Traversal
d. Outoforder Traversal
Feedback
The correct answer is: Preorder traversal
Question 65
Not answered
Marked out of 1.00
Flag question
Question text
A traversal of a general tree that traverses the roots subtrees from left to right, then visits the root is called a preorder traversal.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 66
Not answered
Marked out of 1.00
Flag question
Question text
Which of the following is NOT one of the buffer pool heuristics defined in the text : (select the best answer)
Select one:
a. FIFO
b. LIFO
c. LRU
d. LFU
Feedback
The correct answer is: LIFO
Question 67
Not answered
Marked out of 1.00
Flag question
Question text
A solution is said to be efficient if it:
Select one:
a. Solves the problem within the required resource constraints
b. Executes faster than other solutions
c. Is completed in the fewest number of steps
d. Can be explained in the context of Big-Oh notation
Feedback
The correct answer is: Solves the problem within the required resource constraints
Question 68
Not answered
Marked out of 1.00
Flag question
Question text
The list of children approach uses both pointers and an array structure to represent the tree.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 69
Not answered
Marked out of 1.00
Flag question
Question text
A characteristic of RAM (random access memory) is that it is persistent and is not lost when the power to a computer is turned off.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 70
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select option that represents the most appropriate asymptotic analysis:
for (i=0; i<n; i++) {
//
// Search in array a for smallest element starting at i to n-1
//
minIndex = findSmallestElement(a, i, n-1)
a[i] = a[minIndex];
}
findSmallestElement( int a[], int i, int n ) {
int largest = a[i];
while(i<n) {
if(a[i] >a[largest])
largest = i;
i++;
}
return(largest);
}
Option 1. O( n )
Option 2. O( 2n )
Option 3. O( n log n )
Option 4. O( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
index-of-smallest element in a[i..j] takes j-i+1 operations
• n + (n-1) + (n-2) + (n-3) + ... + 3 + 2 + 1
• this is n2
The correct answer is: Option 4
Question 71
Not answered
Marked out of 1.00
Flag question
Question text
Push and Pop are notations associated with which data structure:
Select one:
a. Queue
b. Stack
c. List
d. Array
Feedback
The correct answer is: Stack
Question 72
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
function ( n ) {
sum2 = 0;
for (i=1; i<=n; i++)
for (j=1; j<=i; j++)
sum2++;
}
}
Choice 1. Ω ( 1 )
Choice 2. O( 2n )
Choice 3. Θ( n2 )
Choice 4. Ω( n2 )
(NOTE: code fragment is not intended to be functioning code)

Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 3
Question 73
Not answered
Marked out of 1.00
Flag question
Question text
The process of storing records in the order that they were added to a file is called:
Select one:
a. Entry-sequenced file
b. Binary Sequenced file
c. LIFO file format
d. Tombstone approach
Feedback
The correct answer is: Entry-sequenced file
Question 74
Not answered
Marked out of 1.00
Flag question
Question text
Secondary storage is characterized by the following:
Select one:
a. It is persistent
b. It is faster than primary storage
c. It is volatile
d. It is more expensive than primary storage
Feedback
The correct answer is: It is persistent
Question 75
Not answered
Marked out of 1.00
Flag question
Question text
Which of the following items is NOT true for Array-Based Lists (please select the best choice):
Choice 1. Insertion and deletion operations are ( n )
Choice 2. Direct access of an item in the array is ( 1 )
Choice 3. Space used grows dynamically as the array is populated
Choice 4. Array contains wasted space if array positions are not full
Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 3
Question 76
Not answered
Marked out of 1.00
Flag question
Question text
A linear index is an index file organized as a sequence of key/pointer pairs where the keys are in a sorter order.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 77
Not answered
Marked out of 1.00
Flag question
Question text
In a stack which option would access the 3rd element from the top of the stack S
Option 1. S.push(-1);
Option 2. S.dequeue(-3);
Option 3. S.pop();
S.pop();
S.pop();
Option 4. S.pop(n-3);
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
The correct answer is: Option 3
Question 78
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the option that represents the most appropriate asymptotic analysis:
// Recursive Fibonacci generator
static long fibr(int n) {
if ((n == 1) || (n == 2)) return 1; // Base case
return fibr(n-1) + fibr(n-2); // Recursive call
}
Option 1. O( n )
Option 2. O( 2n )
Option 3. O( n log n )
Option 4. O( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
The correct answer is: Option 2
Question 79
Not answered
Marked out of 1.00
Flag question
Question text
A binary tree traversal that lists every node in the tree exactly once is called:
Select one:
a. a Traversal
b. A visitor design pattern
c. An enumeration
d. Natural ordering sequence
Feedback
The correct answer is: An enumeration
Question 80
Not answered
Marked out of 1.00
Flag question
Question text
The process of storing blocks of data in main memory after reading from disk is referred to as:
Select one:
a. Buffering
b. Hashing
c. Pooling
d. Indexing
Feedback
The correct answer is: Buffering
Question 81
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
static int function ( n ) {
sum = 0;
for (i=1; i<=n; i++)
sum += n;
return sum;
}
Choice 1. Ω( n2 )
Choice 2. Θ ( n2 )
Choice 3. O( log n )
Choice 4. O( n )
(NOTE: code fragment is not intended to be functioning code)


Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 4
Question 82
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
/** @return The position of an element in sorted array A with value k. If k is not in A,return A.length. */
static int binary(int[] A, int k) {
int l = -1; // Set l and r
int r = A.length; // beyond array bounds
while (l+1 != r) { // Stop when l, r meet
int i = (l+r)/2; // Check middle
if (k < A[i]) r = i; // In left half
if (k == A[i]) return i; // Found it
if (k > A[i]) l = i; // In right half
}
return A.length; // Search value not in A
}
Choice 1. Θ ( n )
Choice 2. O( 2n )
Choice 3. O( log n )
Choice 4. Ω( n2 )
(NOTE: code fragment is not intended to be functioning code)

Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 3
Question 83
Not answered
Marked out of 1.00
Flag question
Question text
A linked list implementation relies upon static memory allocation where static refers to the requirement to pre-allocate all of the memory that will be used for the list.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 84
Not answered
Marked out of 1.00
Flag question
Question text
A traversal that visits each node after visiting its children is called:
Select one:
a. Preorder Traversal
b. Postorder Traversal
c. Inorder Traversal
d. Outoforder Traversal
Feedback
The correct answer is: Postorder Traversal
Question 85
Not answered
Marked out of 1.00
Flag question
Question text
A sort where the list is divided into halves, the halves sorted and these two halves are merged is called:
Select one:
a. Mergesort
b. Binary sort
c. Quicksort
d. Heapsort
Feedback
The correct answer is: Mergesort
Question 86
Not answered
Marked out of 1.00
Flag question
Question text
A coding scheme that replaces repeated occurrences of strings with a pointer to the location in the file of the first occurrence of the string is called Ziv-Lempel coding.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 87
Not answered
Marked out of 1.00
Flag question
Question text
A sort that features a limit of n-1 of record swaps is called:
Select one:
a. Insertion sort
b. Bubble sort
c. Inversion sort
d. Selection sort
Feedback
The correct answer is: Selection sort
Question 88
Not answered
Marked out of 1.00
Flag question
Question text
A finite set of one or more nodes such that there is one designated node call the root is a: (select the best answer)
Select one:
a. Parent root
b. a B+ tree data structure
c. Index
d. Tree
Feedback
The correct answer is: Tree
Question 89
Not answered
Marked out of 1.00
Flag question
Question text
The freelist …
Select one:
a. Provides access to memory within the operating system that has not yet been allocated
b. Provides access to memory objects which have no Big O ( n ) time.
c. Facilitates and encourages the use of the new operator.
d. Holds the list nodes that are no longer in use.
Feedback
The correct answer is: Holds the list nodes that are no longer in use.
Question 90
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the option which represents the most appropriate asymptotic analysis:
static int function ( n ) {
sum = 0;
for (i=1; i<=n; i++)
sum += n;
return sum;
}
Option 1. Ω( n2 )
Option 2. Θ ( n )
Option 3. O( log n )
Option 4. O( 2n )
(NOTE: code fragment is not intended to be functioning code)


Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 2
Question 91
Not answered
Marked out of 1.00
Flag question
Question text
True/False: The stack data structure is implemented as a LIFO structure (last in first out)
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 92
Not answered
Marked out of 1.00
Flag question
Question text
A leaf is any node that:
Select one:
a. Has one child
b. Is an internal node with no ancestors
c. Is any node with two empty children
d. Is the ancestor of the root node
Feedback
The correct answer is: Is any node with two empty children
Question 93
Not answered
Marked out of 1.00
Flag question
Question text
Which of the following is NOT true for Linked Lists structures (please select the best choice):
Choice 1. Insertion and deletion are ( 1 ).
Choice 2. Direct access of an item in the list structure is ( n ).
Choice 3. Space grows with number of elements.
Choice 4. There is no overhead associated with elements in the list structure
Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 4
Question 94
Not answered
Marked out of 1.00
Flag question
Question text
Enqueue and Dequeue are notations associated with which data structure:
Select one:
a. Queue
b. Stack
c. List
d. Array
Feedback
The correct answer is: Queue
Question 95
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
public E getValue ( ) {
assert (curr >= 0) && (curr < listSize) :
"No current element";
return listArray[curr];
}
Choice 1. Θ ( n )
Choice 2. O( 2n )
Choice 3. Θ( n log n )
Choice 4. O( 1 )
(NOTE: code fragment is not intended to be functioning code)


Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 4
Question 96
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the option which represents the most appropriate asymptotic analysis:
/** @return Position of largest value in "A“ */
static int largest(int[] A) {
int currlarge = 0; // Position of largest
for (int i=1; i<A.length; i++)
if (A[currlarge] < A[i])
currlarge = i; // Remember pos
return currlarge; // Return largest pos
}

Choice 1. Θ ( n )
Choice 2. O( 2n )
Choice 3. Θ( n log n )
Choice 4. Ω( n2 )
(NOTE: code fragment is not intended to be functioning code)

Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 1
Question 97
Not answered
Marked out of 1.00
Flag question
Question text
The process of determining if two objects are in the same set and then merging those sets is called:
Select one:
a. a Union Operation
b. Union / Find
c. a Weighted Union
d. a Merge Operation
Feedback
The correct answer is: Union / Find
Question 98
Not answered
Marked out of 1.00
Flag question
Question text
The implementation of a data type as a data structure is the physical form of an ADT.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 99
Not answered
Marked out of 1.00
Flag question
Question text
An important advantage of the sequential tree implementation is that (select the best answer):
Select one:
a. It is an extremely shallow tree
b. The data structure can be transmitted between computers
c. It saves space because no pointers are stored
d. It uses dynamic nodes
Feedback
The correct answer is: It saves space because no pointers are stored
Question 100
Not answered
Marked out of 1.00
Flag question
Question text
The processing time or cost of a sort is defined by the number of comparisons and exchanges that must be made during processing. What is the average cost of the heapsort?:
Option 1. O( n log n )
Option 2. Ω( n2 )
Option 3. O( n2 )
Option 4. Θ( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
The correct answer is: Option 1
Question 101
Not answered
Marked out of 1.00
Flag question
Question text
A significant benefit to using an index to hold and sort keys to a file is:
Select one:
a. Smaller keys require less I/O
b. The entire sort can always be completed in memory
c. The head of the disk drive does not need to move
d. There is no seek time added to the latency of I/O operations
Feedback
The correct answer is: Smaller keys require less I/O
Question 102
Not answered
Marked out of 1.00
Flag question
Question text
If A={1, 2, 3, 4} and B={4, 5, 6}, find A∪ B .
Select one:
a. {1,2,3,4,4,5,6}
b. {4}
c. {x | x is all positive integers}
d. {1,2,3,4,5,6}
Feedback
The correct answer is: {1,2,3,4,5,6}
Question 103
Not answered
Marked out of 1.00
Flag question
Question text
The process of associating a key with the location of a corresponding data record is called folding.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 104
Not answered
Marked out of 1.00
Flag question
Question text
Asymptotic Algorithm Analysis is primarily concerned with:
Select one:
a. The size of the constant in the algorithm running time equation
b. The speed of the computing running the algorithm
c. The speed of the compiler
d. The growth rate demonstrated in the algorithm running time equation
Feedback
The correct answer is: The growth rate demonstrated in the algorithm running time equation
Question 105
Not answered
Marked out of 1.00
Flag question
Question text
What is the role of the pivot in a quicksort algorithm?
Select one:
a. It identifies the maxkey value
b. It specifies the point where the array will be subdivided into partitions and each partition then sorted
c. It defines the sequence for merging in the sort
d. It indicates the index of the current record being compared
Feedback
The correct answer is: It specifies the point where the array will be subdivided into partitions and each partition then sorted
Question 106
Not answered
Marked out of 1.00
Flag question
Question text
Recursion is when an algorithm uses a series of loop structures to repeat an operation until the answer has been computed.
Select one:
True
False
Feedback
The correct answer is 'False'.
A sort that features a limit of n-1 of record swaps is called:
Select one:
a. Insertion sort
b. Bubble sort
c. Inversion sort
d. Selection sort
Feedback
The correct answer is: Selection sort
Question 2
Not answered
Marked out of 1.00
Flag question
Question text
A list is said to be empty when all of its elements have a zero (0) value
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 3
Not answered
Marked out of 1.00
Flag question
Question text
A characteristic of RAM (random access memory) is that it is persistent and is not lost when the power to a computer is turned off.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 4
Not answered
Marked out of 1.00
Flag question
Question text
Correctly identify the following heap structure by selecting the best answer:

Select one:
a. partially ordered heap
b. max-heap structure
c. priority heap
d. min-heap structure
Feedback
The correct answer is: max-heap structure
Question 5
Not answered
Marked out of 1.00
Flag question
Question text
True/False: The queue data structure is implemented as FIFO structure (first in first out)
:
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 6
Not answered
Marked out of 1.00
Flag question
Question text
The process for visiting all of the nodes of a binary tree in some order is called a traversal.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 7
Not answered
Marked out of 1.00
Flag question
Question text
A traversal that visits each node before visiting its children is called:
Select one:
a. Preorder traversal
b. Postorder traversal
c. Inorder Traversal
d. Outoforder Traversal
Feedback
The correct answer is: Preorder traversal
Question 8
Not answered
Marked out of 1.00
Flag question
Question text
A sort where the list is divided into halves, the halves sorted and these two halves are merged is called:
Select one:
a. Mergesort
b. Binary sort
c. Quicksort
d. Heapsort
Feedback
The correct answer is: Mergesort
Question 9
Not answered
Marked out of 1.00
Flag question
Question text
A linked list implementation relies upon static memory allocation where static refers to the requirement to pre-allocate all of the memory that will be used for the list.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 10
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
public E getValue ( ) {
assert (curr >= 0) && (curr < listSize) :
"No current element";
return listArray[curr];
}
Choice 1. Θ ( n )
Choice 2. O( 2n )
Choice 3. Θ( n log n )
Choice 4. O( 1 )
(NOTE: code fragment is not intended to be functioning code)


Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 4
Question 11
Not answered
Marked out of 1.00
Flag question
Question text
The list of children approach uses both pointers and an array structure to represent the tree.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 12
Not answered
Marked out of 1.00
Flag question
Question text
The upper bound for the growth of the Algorithms running time is represented by:
Select one:
a. Big Oh (O)
b. Big Omega (Ω)
c. Big Theta (Θ)
d. Exponential growth
Feedback
The correct answer is: Big Oh (O)
Question 13
Not answered
Marked out of 1.00
Flag question
Question text
A preorder traversal visits every node starting at the leaf nodes and working up the tree.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 14
Not answered
Marked out of 1.00
Flag question
Question text
Select the answer that best defines Huffman Coding:
Select one:
a. A set of coding rules that is typically used for compression
b. A fixed length coding scheme for character representation
c. A tree structure that trades off space and time requirements to provide a more efficient priority queue
d. An approach of assigning codes to characters such that the frequency length of the code depends upon the relative frequency of the corresponding character in use
Feedback
The correct answer is: An approach of assigning codes to characters such that the frequency length of the code depends upon the relative frequency of the corresponding character in use
Question 15
Not answered
Marked out of 1.00
Flag question
Question text
An exchange sort is one where: (select the best answer)
Select one:
a. Records in an unsorted list are moved to a sorted list
b. Adjacent records in the list and compared and exchanged
c. An inversion is executed
d. The sorting algorithm is said to be stable
Feedback
The correct answer is: Adjacent records in the list and compared and exchanged
Question 16
Not answered
Marked out of 1.00
Flag question
Question text
The processing time or cost of a sort is defined by the number of comparisons and exchanges that must be made during processing. What is the average cost of the heapsort?:
Option 1. O( n log n )
Option 2. Ω( n2 )
Option 3. O( n2 )
Option 4. Θ( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
The correct answer is: Option 1
Question 17
Not answered
Marked out of 1.00
Flag question
Question text
A linked list creates order through the use of pointers that link one element to another.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 18
Not answered
Marked out of 1.00
Flag question
Question text
A technique that allows a programmer to use more main memory than exists in the computer is called: (select the best answer)
Select one:
a. Buffer cache
b. Random access memory
c. Secondary storage
d. Virtual memory
Feedback
The correct answer is: Virtual memory
Question 19
Not answered
Marked out of 1.00
Flag question
Question text
A list that organizes the order of records within the list based upon patterns of actual record access is called a/an (select the best answer):
Select one:
a. Quadratic Binary search order
b. A Zipf Distribution
c. A Self-organizing list
d. A range query
Feedback
The correct answer is: A Self-organizing list
Question 20
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
static int function ( n ) {
sum = 0;
for (j=1; j<=n; j++)
for (i=1; i<=j; i++)
sum++;
return sum;
}
Choice 1. Θ ( n )
Choice 2. O( 2n )
Choice 3. Θ( n2 )
Choice 4. Ω( n2 )
(NOTE: code fragment is not intended to be functioning code)


Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 3
Question 21
Not answered
Marked out of 1.00
Flag question
Question text
A tree data structure whose shape obeys the following definition,
o A node contains one or two keys
o Every internal node has either 2 children if it contains 1 key or 3 children if it contains two keys
o All leaves are at the same level in the tree
Is called a/an:
Select one:
a. B*-Tree
b. BST
c. B+-Tree
d. 2-3 tree
Feedback
The correct answer is: 2-3 tree
Question 22
Not answered
Marked out of 1.00
Flag question
Question text
A collection of one or more trees is called:
Select one:
a. Trees
b. Multiple Spanning Trees
c. a Forest
d. Traversals
Feedback
The correct answer is: a Forest
Question 23
Not answered
Marked out of 1.00
Flag question
Question text
The most significant difference between the B+-Tree and the BST is that the B+-Tree stores records only at the leaf nodes.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 24
Not answered
Marked out of 1.00
Flag question
Question text
A list is
Select one:
a. An ADT for storing and retrieving data
b. A tree data structure
c. Finite ordered sequence of data items
d. A collection of operations to implement an ADT
Feedback
The correct answer is: Finite ordered sequence of data items
Question 25
Not answered
Marked out of 1.00
Flag question
Question text
Which of the following is NOT one of the buffer pool heuristics defined in the text : (select the best answer)
Select one:
a. FIFO
b. LIFO
c. LRU
d. LFU
Feedback
The correct answer is: LIFO
Question 26
Not answered
Marked out of 1.00
Flag question
Question text
Which of the following is not one of the general approaches to search algorithms:
Select one:
a. Buffer cache access methods
b. Sequential and list methods
c. Direct access by key value (hashing)
d. Tree indexing methods
Feedback
The correct answer is: Buffer cache access methods
Question 27
Not answered
Marked out of 1.00
Flag question
Question text
Which of the following is not a mathematical proof technique?
Select one:
a. Proof by mathematical induction
b. Proof by contradiction
c. Direct proof
d. Proof by consensus
Feedback
The correct answer is: Proof by consensus
Question 28
Not answered
Marked out of 1.00
Flag question
Question text
A tree whose internal nodes all have exactly K children is called a K-ary tree.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 29
Not answered
Marked out of 1.00
Flag question
Question text
The freelist …
Select one:
a. Provides access to memory within the operating system that has not yet been allocated
b. Provides access to memory objects which have no Big O ( n ) time.
c. Facilitates and encourages the use of the new operator.
d. Holds the list nodes that are no longer in use.
Feedback
The correct answer is: Holds the list nodes that are no longer in use.
Question 30
Not answered
Marked out of 1.00
Flag question
Question text
A full binary tree has a restricted shape which starts at the root and fills the tree by levels from left to right.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 31
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the option that represents the most appropriate asymptotic analysis:
for (int i = 1; i <= n; i *= 2) {
for (int j = 0; j < n; j++) {
count++;
}
}
Option 1. O( 1 )
Option 2. O( 2n )
Option 3. O( n log n )
Option 4. O( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
Explanation: Here the outer loop is done log n times and the inner loop is done n times, so T(n) = n log n. (Note that the default base for logarithms in Computer Science is 2.)
The correct answer is: Option 3
Question 32
Not answered
Marked out of 1.00
Flag question
Question text
A leaf is any node that:
Select one:
a. Has one child
b. Is an internal node with no ancestors
c. Is any node with two empty children
d. Is the ancestor of the root node
Feedback
The correct answer is: Is any node with two empty children
Question 33
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the most appropriate asymptotic analysis:
// Towers of Hanoi
static void solveHanoi(int disks, char fromPole, char toPole, char withPole) {
if (disks >= 1) {
solveHanoi(disks-1, fromPole, withPole, toPole);
moveDisk(fromPole, toPole);
solveHanoi(disks-1, withPole, toPole, fromPole);
}
}
static void moveDisk(char fromPole, char toPole) {
moves++;
}
Option 1. O( n )
Option 2. O( 2n )
Option 3. O( n log n )
Option 4. O( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
The correct answer is: Option 2
Question 34
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
function ( n ) {
sum1 = 0;
for (k=1; k<=n; k*=2)
for (j=1; j<=n; j++)
sum1++;
}
Choice 1. Θ ( n )
Choice 2. O( 2n )
Choice 3. Θ( n log n )
Choice 4. Ω( n2 )
(NOTE: code fragment is not intended to be functioning code)

Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 3
Question 35
Not answered
Marked out of 1.00
Flag question
Question text
Asymptotic Algorithm Analysis is primarily concerned with:
Select one:
a. The size of the constant in the algorithm running time equation
b. The speed of the computing running the algorithm
c. The speed of the compiler
d. The growth rate demonstrated in the algorithm running time equation
Feedback
The correct answer is: The growth rate demonstrated in the algorithm running time equation
Question 36
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
static int function ( n ) {
sum = 0;
for (i=1; i<=n; i++)
sum += n;
return sum;
}
Choice 1. Ω( n2 )
Choice 2. Ω( log n2 )
Choice 3. Θ( n log n )
Choice 4. O ( n )
(NOTE: code fragment is not intended to be functioning code)



Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 4
Question 37
Not answered
Marked out of 1.00
Flag question
Question text
The benefit of a quicksort is that it provides excellent performance in both the average and worst case:
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 38
Not answered
Marked out of 1.00
Flag question
Question text
If A={1, 2, 3, 4} and B={4, 5, 6}, find A∪ B .
Select one:
a. {1,2,3,4,4,5,6}
b. {4}
c. {x | x is all positive integers}
d. {1,2,3,4,5,6}
Feedback
The correct answer is: {1,2,3,4,5,6}
Question 39
Not answered
Marked out of 1.00
Flag question
Question text
The weighted union rule joins a tree with fewer nodes to a tree with more nodes by making the smaller tree’s root point to the root of the larger tree.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 40
Not answered
Marked out of 1.00
Flag question
Question text
A compound computed search that combines a binary search to get close to the required record and then uses sequential search to find the item is referred to as a/an:
Select one:
a. Zipf search
b. An Exact match search
c. A Dictionary search
d. bit map vector search
Feedback
The correct answer is: A Dictionary search
Question 41
Not answered
Marked out of 1.00
Flag question
Question text
The process of storing records in the order that they were added to a file is called:
Select one:
a. Entry-sequenced file
b. Binary Sequenced file
c. LIFO file format
d. Tombstone approach
Feedback
The correct answer is: Entry-sequenced file
Question 42
Not answered
Marked out of 1.00
Flag question
Question text
Each record of a database normally has a unique identifier called the:
Select one:
a. Secondary Key
b. Primary index
c. Primary key
d. Index key
Feedback
The correct answer is: Primary key
Question 43
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
static int function ( n ) {
for (k=0; k<n; k++)
A[k] = k;
return A[k];
}
Choice 1. Θ ( n log n )
Choice 2. O( 2n )
Choice 3. O( n )
Choice 4. Ω( n2 )
(NOTE: code fragment is not intended to be functioning code)



Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 3
Question 44
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the option that represents the most appropriate asymptotic analysis:
// Recursive Fibonacci generator
static long fibr(int n) {
if ((n == 1) || (n == 2)) return 1; // Base case
return fibr(n-1) + fibr(n-2); // Recursive call
}
Option 1. O( n )
Option 2. O( 2n )
Option 3. O( n log n )
Option 4. O( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
The correct answer is: Option 2
Question 45
Not answered
Marked out of 1.00
Flag question
Question text
A traversal that visits each node after visiting its children is called:
Select one:
a. Preorder Traversal
b. Postorder Traversal
c. Inorder Traversal
d. Outoforder Traversal
Feedback
The correct answer is: Postorder Traversal
Question 46
Not answered
Marked out of 1.00
Flag question
Question text
True/False: Big Theta (Θ) indicates that the Upper and Lower bounds of an algorithm are the same.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 47
Not answered
Marked out of 1.00
Flag question
Question text
A sort algorithm that uses two nested loops with the inner loop moving through the array from bottom to top is called the:
Select one:
a. Insertion sort
b. Bubble sort
c. Inversion sort
d. Selection sort
Feedback
The correct answer is: Bubble sort
Question 48
Not answered
Marked out of 1.00
Flag question
Question text
The most time consuming of the following operations on an array based list implementation is:
Select one:
a. Inserting a new element at position n-1 in the list where n is the number of elements in the list.
b. Inserting a new element into the head of the list.
c. Removing an element at position n-1 within the list
d. Removing an element from the tail of the list.
Feedback
The correct answer is: Inserting a new element into the head of the list.
Question 49
Not answered
Marked out of 1.00
Flag question
Question text
A coding scheme that replaces repeated occurrences of strings with a pointer to the location in the file of the first occurrence of the string is called Ziv-Lempel coding.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 50
Not answered
Marked out of 1.00
Flag question
Question text
Internal Fragmentation refers to: (select the best answer)
Select one:
a. Space that is left empty because records do not fit evenly into a sector
b. Space allocated to a file that is not physically adjacent on the disk drive
c. Space that is left empty because records do not fit evenly into a sector or Space allocated to a file that is not physically adjacent
d. None of the options
Feedback
The correct answer is: Space that is left empty because records do not fit evenly into a sector or Space allocated to a file that is not physically adjacent
Question 51
Not answered
Marked out of 1.00
Flag question
Question text
True/False: There is always one most efficient algorithm to solve a particular problem.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 52
Not answered
Marked out of 1.00
Flag question
Question text
A sorting algorithm that assigns records to bins and then relies on some other sorting technique to sort the records within each bin called:
Select one:
a. Radix Sort
b. Quicksort
c. Hash sort
d. Bucket sort
Feedback
The correct answer is: Bucket sort
Question 53
Not answered
Marked out of 1.00
Flag question
Question text
In a queue, placing new items in the queue is referred to as a push and taking an item out of the queue is called a pop.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 54
Not answered
Marked out of 1.00
Flag question
Question text
A binary tree traversal that lists every node in the tree exactly once is called:
Select one:
a. a Traversal
b. A visitor design pattern
c. An enumeration
d. Natural ordering sequence
Feedback
The correct answer is: An enumeration
Question 55
Not answered
Marked out of 1.00
Flag question
Question text
A finite set of one or more nodes such that there is one designated node call the root is a: (select the best answer)
Select one:
a. Parent root
b. a B+ tree data structure
c. Index
d. Tree
Feedback
The correct answer is: Tree
Question 56
Not answered
Marked out of 1.00
Flag question
Question text
An important advantage of the sequential tree implementation is that (select the best answer):
Select one:
a. It is an extremely shallow tree
b. The data structure can be transmitted between computers
c. It saves space because no pointers are stored
d. It uses dynamic nodes
Feedback
The correct answer is: It saves space because no pointers are stored
Question 57
Not answered
Marked out of 1.00
Flag question
Question text
Which of the following items is NOT true for Array-Based Lists (please select the best choice):
Choice 1. Insertion and deletion operations are ( n )
Choice 2. Direct access of an item in the array is ( 1 )
Choice 3. Space used grows dynamically as the array is populated
Choice 4. Array contains wasted space if array positions are not full
Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 3
Question 58
Not answered
Marked out of 1.00
Flag question
Question text
A linear index is an index file organized as a sequence of key/pointer pairs where the keys are in a sorter order.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 59
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the option which represents the most appropriate asymptotic analysis:
static int function ( n ) {
sum = 0;
for (i=1; i<=n; i++)
sum += n;
return sum;
}
Option 1. Ω( n2 )
Option 2. Θ ( n )
Option 3. O( log n )
Option 4. O( 2n )
(NOTE: code fragment is not intended to be functioning code)


Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 2
Question 60
Not answered
Marked out of 1.00
Flag question
Question text
The lower bound for the growth of the Algorithms running time is represented by (please the best answer):
1. Big Oh (O)
2. Big Omega (Ω)
3. Big Theta (Θ)
4. Exponential growth
Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 2
Question 61
Not answered
Marked out of 1.00
Flag question
Question text
A solution is said to be efficient if it:
Select one:
a. Solves the problem within the required resource constraints
b. Executes faster than other solutions
c. Is completed in the fewest number of steps
d. Can be explained in the context of Big-Oh notation
Feedback
The correct answer is: Solves the problem within the required resource constraints
Question 62
Not answered
Marked out of 1.00
Flag question
Question text
In a stack which option would access the 3rd element from the top of the stack S
Option 1. S.push(-1);
Option 2. S.dequeue(-3);
Option 3. S.pop();
S.pop();
S.pop();
Option 4. S.pop(n-3);
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
The correct answer is: Option 3
Question 63
Not answered
Marked out of 1.00
Flag question
Question text
According to textbook by Shaffer, a heap data structure has two properties which are:
Select one:
a. every node stores a value less than or equal to that of its children and it is a complete binary tree
b. it is a min-heap and is partially ordered
c. it is a complete binary tree and the values stored in it are partially ordered
d. it is a priority queue and is in Θ( n )
Feedback
The correct answer is: it is a complete binary tree and the values stored in it are partially ordered
Question 64
Not answered
Marked out of 1.00
Flag question
Question text
The quicksort is typically slower than the heapsort by a constant factor.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 65
Not answered
Marked out of 1.00
Flag question
Question text
Which of the following is NOT true for Linked Lists structures (please select the best choice):
Choice 1. Insertion and deletion are ( 1 ).
Choice 2. Direct access of an item in the list structure is ( n ).
Choice 3. Space grows with number of elements.
Choice 4. There is no overhead associated with elements in the list structure
Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 4
Question 66
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the option that represents the most appropriate asymptotic analysis:
for (int i = 0; i < a.length; i++) {
System.out.println(a[i]);
}
Option 1. O( n )
Option 2. O( 2n )
Option 3. O( n log n )
Option 4. O( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
The correct answer is: Option 1
Question 67
Not answered
Marked out of 1.00
Flag question
Question text
Secondary storage is characterized by the following:
Select one:
a. It is persistent
b. It is faster than primary storage
c. It is volatile
d. It is more expensive than primary storage
Feedback
The correct answer is: It is persistent
Question 68
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the option which represents the most appropriate asymptotic analysis:
/** @return Position of largest value in "A“ */
static int largest(int[] A) {
int currlarge = 0; // Position of largest
for (int i=1; i<A.length; i++)
if (A[currlarge] < A[i])
currlarge = i; // Remember pos
return currlarge; // Return largest pos
}

Choice 1. Θ ( n )
Choice 2. O( 2n )
Choice 3. Θ( n log n )
Choice 4. Ω( n2 )
(NOTE: code fragment is not intended to be functioning code)

Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 1
Question 69
Not answered
Marked out of 1.00
Flag question
Question text
The upper bound for the growth of the Algorithms running time is represented by (please select the best answer):
1. Big Oh (O)
2. Big Omega (Ω)
3. Big Theta (Θ)
4. Exponential growth
Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 1
Question 70
Not answered
Marked out of 1.00
Flag question
Question text
Data is stored within the disk drive on the: (select the best answer)
Select one:
a. Spindle
b. Platter
c. Cylinder
d. Sector
Feedback
The correct answer is: Platter
Question 71
Not answered
Marked out of 1.00
Flag question
Question text
A sequential tree can be represented using a bit vector?
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 72
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
function ( n ) {
sum2 = 0;
for (k=1; k<=n; k*=2)
for (j=1; j<=k; j++)
sum2++;
}
Choice 1. O( 2n )
Choice 2. Θ ( n )
Choice 3. Θ( n log n )
Choice 4. Ω( n2 )
(NOTE: code fragment is not intended to be functioning code)

Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 2
Question 73
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the option that represents the most appropriate asymptotic analysis:
if (a.length > 0) {
return a[a.length - 1];
} else {
throw new NoSuchElementException();
}
Option 1. O( 1 )
Option 2. O( 2n )
Option 3. O( n log n )
Option 4. O( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
Explanation: Here n = a.length, and T(n) = 1.
The correct answer is: Option 1
Question 74
Not answered
Marked out of 1.00
Flag question
Question text
Recursion is when an algorithm uses a series of loop structures to repeat an operation until the answer has been computed.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 75
Not answered
Marked out of 1.00
Flag question
Question text
The process of associating a key with the location of a corresponding data record is called folding.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 76
Not answered
Marked out of 1.00
Flag question
Question text
An ADT is:
Select one:
a. A type together with a collection of operations to manipulate the type
b. An implementation of a flyweight design pattern
c. The realization of a data type as a software component
d. An implementation in java of a class for a data type
Feedback
The correct answer is: The realization of a data type as a software component
Question 77
Not answered
Marked out of 1.00
Flag question
Question text
Enqueue and Dequeue are notations associated with which data structure:
Select one:
a. Queue
b. Stack
c. List
d. Array
Feedback
The correct answer is: Queue
Question 78
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
function ( n ) {
sum1 = 0;
for (i=1; i<=n; i++)
for (j=1; j<=n; j++)
sum1++;
}
Choice 1. Θ ( n2 )
Choice 2. O( 2n )
Choice 3. Θ( n log n )
Choice 4. Ω( log n2 )
(NOTE: code fragment is not intended to be functioning code)

Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 1
Question 79
Not answered
Marked out of 1.00
Flag question
Question text
Which of the following is not a characteristic of an algorithm?
Select one:
a. It must be correct
b. It must be composed of concrete steps
c. It can have no ambiguity
d. It must be composed of an infinite number of steps.
Feedback
The correct answer is: It must be composed of an infinite number of steps.
Question 80
Not answered
Marked out of 1.00
Flag question
Question text
Setting the dirty bit causes what action to be performed on a block: (select the best answer)
Select one:
a. It is deleted because it is no longer consistent
b. It flushes or writes the block out to the disk
c. Refreshes the data by re-reading the block
d. It cleans the cache by flushing all data from the cache
Feedback
The correct answer is: It flushes or writes the block out to the disk
Question 81
Not answered
Marked out of 1.00
Flag question
Question text
A traversal that visits the left subtree, then the node, and then the right subtree is called:

Select one:
a. Preorder Traversal
b. Postorder Traversal
c. Inorder Traversal
d. Outoforder Traversal
Feedback
The correct answer is: Inorder Traversal
Question 82
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
/** @return The position of an element in sorted array A with value k. If k is not in A,return A.length. */
static int binary(int[] A, int k) {
int l = -1; // Set l and r
int r = A.length; // beyond array bounds
while (l+1 != r) { // Stop when l, r meet
int i = (l+r)/2; // Check middle
if (k < A[i]) r = i; // In left half
if (k == A[i]) return i; // Found it
if (k > A[i]) l = i; // In right half
}
return A.length; // Search value not in A
}
Choice 1. Θ ( n )
Choice 2. O( 2n )
Choice 3. O( log n )
Choice 4. Ω( n2 )
(NOTE: code fragment is not intended to be functioning code)

Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 3
Question 83
Not answered
Marked out of 1.00
Flag question
Question text
In linked lists there are no NULL links in:
Select one:
a. Single linked list
b. Linear doubly linked list
c. Circular linked list
d. None of these
Feedback
The correct answer is: Circular linked list
Question 84
Not answered
Marked out of 1.00
Flag question
Question text
The process of determining if two objects are in the same set and then merging those sets is called:
Select one:
a. a Union Operation
b. Union / Find
c. a Weighted Union
d. a Merge Operation
Feedback
The correct answer is: Union / Find
Question 85
Not answered
Marked out of 1.00
Flag question
Question text
What is the role of the pivot in a quicksort algorithm?
Select one:
a. It identifies the maxkey value
b. It specifies the point where the array will be subdivided into partitions and each partition then sorted
c. It defines the sequence for merging in the sort
d. It indicates the index of the current record being compared
Feedback
The correct answer is: It specifies the point where the array will be subdivided into partitions and each partition then sorted
Question 86
Not answered
Marked out of 1.00
Flag question
Question text
When big-Oh and  coincide, we indicate this by using (select the best answer):
1. Big Oh (O)
2. Big Omega (Ω)
3. Big Theta (Θ)
4. Exponential growth
Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 3
Question 87
Not answered
Marked out of 1.00
Flag question
Question text
A traversal of a general tree that traverses the roots subtrees from left to right, then visits the root is called a preorder traversal.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 88
Not answered
Marked out of 1.00
Flag question
Question text
Which of the following is NOT one of the design patterns outlined in our text.
Select one:
a. Flyweight
b. Visitor
c. Composite
d. Synergy
Feedback
The correct answer is: Synergy
Question 89
Not answered
Marked out of 1.00
Flag question
Question text
Push and Pop are notations associated with which data structure:
Select one:
a. Queue
b. Stack
c. List
d. Array
Feedback
The correct answer is: Stack
Question 90
Not answered
Marked out of 1.00
Flag question
Question text
True/False: The stack data structure is implemented as a LIFO structure (last in first out)
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 91
Not answered
Marked out of 1.00
Flag question
Question text
An algorithm that breaks a file to be sorted in smaller files called runs which are sorted and eventually put back together resulting in a sorted file is called:
Select one:
a. Quicksort algorithm
b. Replacement sort algorithm
c. An indexed key sort algorithm
d. Mergesort algorithm
Feedback
The correct answer is: Mergesort algorithm
Question 92
Not answered
Marked out of 1.00
Flag question
Question text
The process of storing blocks of data in main memory after reading from disk is referred to as:
Select one:
a. Buffering
b. Hashing
c. Pooling
d. Indexing
Feedback
The correct answer is: Buffering
Question 93
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select option that represents the most appropriate asymptotic analysis:
for (i=0; i<n; i++) {
//
// Search in array a for smallest element starting at i to n-1
//
minIndex = findSmallestElement(a, i, n-1)
a[i] = a[minIndex];
}
findSmallestElement( int a[], int i, int n ) {
int largest = a[i];
while(i<n) {
if(a[i] >a[largest])
largest = i;
i++;
}
return(largest);
}
Option 1. O( n )
Option 2. O( 2n )
Option 3. O( n log n )
Option 4. O( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
index-of-smallest element in a[i..j] takes j-i+1 operations
• n + (n-1) + (n-2) + (n-3) + ... + 3 + 2 + 1
• this is n2
The correct answer is: Option 4
Question 94
Not answered
Marked out of 1.00
Flag question
Question text
The depth of node H in the following tree is:

Select one:
a. 3
b. 2
c. 4
d. 1
Feedback
The correct answer is: 3
Question 95
Not answered
Marked out of 1.00
Flag question
Question text
The implementation of a data type as a data structure is the physical form of an ADT.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 96
Not answered
Marked out of 1.00
Flag question
Question text
A method that is designed to create extremely shallow trees is called:
Select one:
a. Dynamic node implementation
b. Union/Find
c. The list of children method
d. Path compression
Feedback
The correct answer is: Path compression
Question 97
Not answered
Marked out of 1.00
Flag question
Question text
True/False: Big Theta (Θ) indicates that the Upper and Lower bounds of an algorithm are the same.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 98
Not answered
Marked out of 1.00
Flag question
Question text
According to the properties of logarithms, log(nm) =
Note: Due to issues with HTML formatting, an exponent is represented by preceding it with the ^ symbol. As such x^2 is equivalent to x2.
Select one:
a. log n – log m
b. n log n
c. log n + log m
d. log(n^m)
Feedback
The correct answer is: log n + log m
Question 99
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
static int function ( n ) {
for (k=0; k<n; k++)
A[k] = k;
return A[k];
}
Choice 1. O ( n2 )
Choice 2. O( 2n )
Choice 3. Ω( n2 )
Choice 4. Θ ( n )
(NOTE: code fragment is not intended to be functioning code)

Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 4
Question 100
Not answered
Marked out of 1.00
Flag question
Question text
The full binary tree theorem states “the number of leaves in an empty full binary tree is one more than the number of internal nodes”
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 101
Not answered
Marked out of 1.00
Flag question
Question text
A significant benefit to using an index to hold and sort keys to a file is:
Select one:
a. Smaller keys require less I/O
b. The entire sort can always be completed in memory
c. The head of the disk drive does not need to move
d. There is no seek time added to the latency of I/O operations
Feedback
The correct answer is: Smaller keys require less I/O
Question 102
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
function ( n ) {
sum2 = 0;
for (i=1; i<=n; i++)
for (j=1; j<=i; j++)
sum2++;
}
}
Choice 1. Ω ( 1 )
Choice 2. O( 2n )
Choice 3. Θ( n2 )
Choice 4. Ω( n2 )
(NOTE: code fragment is not intended to be functioning code)

Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 3
Question 103
Not answered
Marked out of 1.00
Flag question
Question text
The best asymptotic analysis for the selection sort is represented by (select the best option):
Option 1. O( n log n )
Option 2. Ω( n2 )
Option 3. O( n2 )
Option 4. Θ( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
The correct answer is: Option 4
Question 104
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the option that represents the most appropriate asymptotic analysis:
public static int binarySearch(int[] a, int key) {
int left = 0;
int right = a.length-1;
while (left <= right) {
int mid = left + (right-left)/2;
if (key < a[mid]) right = mid-1;
else if (key > a[mid]) left = mid+1;
else return mid;
}
//not found
return -1;
}
Option 1. Ω( 1 ), O( log n )
Option 2. Ω( n ), O( 2n )
Option 3. Θ( n log n )
Option 4. Θ( log n )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
The correct answer is: Option 1
Question 105
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
static int function ( n ) {
sum = 0;
for (i=1; i<=n; i++)
sum += n;
return sum;
}
Choice 1. Ω( n2 )
Choice 2. Θ ( n2 )
Choice 3. O( log n )
Choice 4. O( n )
(NOTE: code fragment is not intended to be functioning code)


Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 4
Question 106
Not answered
Marked out of 1.00
Flag question
Question text
Inserting or removing an item at position n-1 within a linked list has the same cost in terms  ( n ) time as the same operation in an array based implementation of a list.
Select one:
True
False
Feedback
The correct answer is 'False'.
A solution is said to be efficient if it:
Select one:
a. Solves the problem within the required resource constraints
b. Executes faster than other solutions
c. Is completed in the fewest number of steps
d. Can be explained in the context of Big-Oh notation
Feedback
The correct answer is: Solves the problem within the required resource constraints
Question 2
Correct
Mark 1.00 out of 1.00
Flag question
Question text
An ADT is:
Select one:
a. A type together with a collection of operations to manipulate the type
b. An implementation of a flyweight design pattern
c. The realization of a data type as a software component
d. An implementation in java of a class for a data type
Feedback
The correct answer is: The realization of a data type as a software component
Question 3
Correct
Mark 1.00 out of 1.00
Flag question
Question text
The implementation of a data type as a data structure is the physical form of an ADT.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 4
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Which of the following is NOT one of the design patterns outlined in our text.
Select one:
a. Flyweight
b. Visitor
c. Composite
d. Synergy
Feedback
The correct answer is: Synergy
Question 5
Incorrect
Mark 0.00 out of 1.00
Flag question
Question text
If A={1, 2, 3, 4} and B={4, 5, 6}, find A∪ B .
Select one:
a. {1,2,3,4,4,5,6}
b. {4}
c. {x | x is all positive integers}
d. {1,2,3,4,5,6}
Feedback
The correct answer is: {1,2,3,4,5,6}
Question 6
Correct
Mark 1.00 out of 1.00
Flag question
Question text
According to the properties of logarithms, log(nm) =
Note: Due to issues with HTML formatting, an exponent is represented by preceding it with the ^ symbol. As such x^2 is equivalent to x2.
Select one:
a. log n – log m
b. n log n
c. log n + log m
d. log(n^m)
Feedback
The correct answer is: log n + log m
Question 7
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Recursion is when an algorithm uses a series of loop structures to repeat an operation until the answer has been computed.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 8
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Which of the following is not a mathematical proof technique?
Select one:
a. Proof by mathematical induction
b. Proof by contradiction
c. Direct proof
d. Proof by consensus
Feedback
The correct answer is: Proof by consensus
Question 9
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Which of the following is not a characteristic of an algorithm?
Select one:
a. It must be correct
b. It must be composed of concrete steps
c. It can have no ambiguity
d. It must be composed of an infinite number of steps.
Feedback
The correct answer is: It must be composed of an infinite number of steps
The upper bound for the growth of the Algorithms running time is represented by:
Select one:
a. Big Oh (O)
b. Big Omega (Ω)
c. Big Theta (Θ)
d. Exponential growth
Feedback
The correct answer is: Big Oh (O)
Question 2
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Asymptotic Algorithm Analysis is primarily concerned with:
Select one:
a. The size of the constant in the algorithm running time equation
b. The speed of the computing running the algorithm
c. The speed of the compiler
d. The growth rate demonstrated in the algorithm running time equation
Feedback
The correct answer is: The growth rate demonstrated in the algorithm running time equation
Question 3
Correct
Mark 1.00 out of 1.00
Flag question
Question text
True/False: Big Theta (Θ) indicates that the Upper and Lower bounds of an algorithm are the same.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 4
Correct
Mark 1.00 out of 1.00
Flag question
Question text
For the following code fragment, select the option that represents the most appropriate asymptotic analysis:
for (int i = 0; i < a.length; i++) {
System.out.println(a[i]);
}
Option 1. O( n )
Option 2. O( 2n )
Option 3. O( n log n )
Option 4. O( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
The correct answer is: Option 1
Question 5
Correct
Mark 1.00 out of 1.00
Flag question
Question text
For the following code fragment, select the option that represents the most appropriate asymptotic analysis:
for (int i = 1; i <= n; i *= 2) {
for (int j = 0; j < n; j++) {
count++;
}
}
Option 1. O( 1 )
Option 2. O( 2n )
Option 3. O( n log n )
Option 4. O( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
Explanation: Here the outer loop is done log n times and the inner loop is done n times, so T(n) = n log n. (Note that the default base for logarithms in Computer Science is 2.)
The correct answer is: Option 3
Question 6
Correct
Mark 1.00 out of 1.00
Flag question
Question text
For the following code fragment, select the option that represents the most appropriate asymptotic analysis:
if (a.length > 0) {
return a[a.length - 1];
} else {
throw new NoSuchElementException();
}
Option 1. O( 1 )
Option 2. O( 2n )
Option 3. O( n log n )
Option 4. O( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
Explanation: Here n = a.length, and T(n) = 1.
The correct answer is: Option 1
Question 7
Correct
Mark 1.00 out of 1.00
Flag question
Question text
For the following code fragment, select the most appropriate asymptotic analysis:
// Towers of Hanoi
static void solveHanoi(int disks, char fromPole, char toPole, char withPole) {
if (disks >= 1) {
solveHanoi(disks-1, fromPole, withPole, toPole);
moveDisk(fromPole, toPole);
solveHanoi(disks-1, withPole, toPole, fromPole);
}
}
static void moveDisk(char fromPole, char toPole) {
moves++;
}
Option 1. O( n )
Option 2. O( 2n )
Option 3. O( n log n )
Option 4. O( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
The correct answer is: Option 2
Question 8
Correct
Mark 1.00 out of 1.00
Flag question
Question text
For the following code fragment, select the option that represents the most appropriate asymptotic analysis:
public static int binarySearch(int[] a, int key) {
int left = 0;
int right = a.length-1;
while (left <= right) {
int mid = left + (right-left)/2;
if (key < a[mid]) right = mid-1;
else if (key > a[mid]) left = mid+1;
else return mid;
}
//not found
return -1;
}
Option 1. Ω( 1 ), O( log n )
Option 2. Ω( n ), O( 2n )
Option 3. Θ( n log n )
Option 4. Θ( log n )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
The correct answer is: Option 1
Question 9
Correct
Mark 1.00 out of 1.00
Flag question
Question text
For the following code fragment, select option that represents the most appropriate asymptotic analysis:
for (i=0; i<n; i++) {
//
// Search in array a for smallest element starting at i to n-1
//
minIndex = findSmallestElement(a, i, n-1)
a[i] = a[minIndex];
}
findSmallestElement( int a[], int i, int n ) {
int largest = a[i];
while(i<n) {
if(a[i] >a[largest])
largest = i;
i++;
}
return(largest);
}
Option 1. O( n )
Option 2. O( 2n )
Option 3. O( n log n )
Option 4. O( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
index-of-smallest element in a[i..j] takes j-i+1 operations
• n + (n-1) + (n-2) + (n-3) + ... + 3 + 2 + 1
• this is n2
The correct answer is: Option 4
Question 10
Correct
Mark 1.00 out of 1.00
Flag question
Question text
For the following code fragment, select the option that represents the most appropriate asymptotic analysis:
// Recursive Fibonacci generator
static long fibr(int n) {
if ((n == 1) || (n == 2)) return 1; // Base case
return fibr(n-1) + fibr(n-2); // Recursive call
}
Option 1. O( n )
Option 2. O( 2n )
Option 3. O( n log n )
Option 4. O( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
The correct answer is: Option 2
Top of Form
A list is
Select one:
a. An ADT for storing and retrieving data
b. A tree data structure
c. Finite ordered sequence of data items
d. A collection of operations to implement an ADT
Feedback
The correct answer is: Finite ordered sequence of data items
Question 2
Correct
Mark 1.00 out of 1.00
Flag question
Question text
A list is said to be empty when all of its elements have a zero (0) value
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 3
Correct
Mark 1.00 out of 1.00
Flag question
Question text
The most time consuming of the following operations on an array based list implementation is:
Select one:
a. Inserting a new element at position n-1 in the list where n is the number of elements in the list.
b. Inserting a new element into the head of the list.
c. Removing an element at position n-1 within the list
d. Removing an element from the tail of the list.
Feedback
The correct answer is: Inserting a new element into the head of the list.
Question 4
Correct
Mark 1.00 out of 1.00
Flag question
Question text
A linked list implementation relies upon static memory allocation where static refers to the requirement to pre-allocate all of the memory that will be used for the list.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 5
Correct
Mark 1.00 out of 1.00
Flag question
Question text
A linked list creates order through the use of pointers that link one element to another.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 6
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Inserting or removing an item at position n-1 within a linked list has the same cost in terms  ( n ) time as the same operation in an array based implementation of a list.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 7
Correct
Mark 1.00 out of 1.00
Flag question
Question text
The freelist …
Select one:
a. Provides access to memory within the operating system that has not yet been allocated
b. Provides access to memory objects which have no Big O ( n ) time.
c. Facilitates and encourages the use of the new operator.
d. Holds the list nodes that are no longer in use.
Feedback
The correct answer is: Holds the list nodes that are no longer in use.
Question 8
Correct
Mark 1.00 out of 1.00
Flag question
Question text
In a queue, placing new items in the queue is referred to as a push and taking an item out of the queue is called a pop.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 9
Incorrect
Mark 0.00 out of 1.00
Flag question
Question text
In linked lists there are no NULL links in:
Select one:
a. Single linked list
b. Linear doubly linked list
c. Circular linked list
d. None of these
Feedback
The correct answer is: Circular linked list
Question 10
Correct
Mark 1.00 out of 1.00
Flag question
Question text
In a stack which option would access the 3rd element from the top of the stack S
Option 1. S.push(-1);
Option 2. S.dequeue(-3);
Option 3. S.pop();
S.pop();
S.pop();
Option 4. S.pop(n-3);
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
The correct answer is: Option 3
Bottom of Form
A leaf is any node that:
Select one:
a. Has one child
b. Is an internal node with no ancestors
c. Is any node with two empty children
d. Is the ancestor of the root node
Feedback
The correct answer is: Is any node with two empty children
Question 2
Correct
Mark 1.00 out of 1.00
Flag question
Question text
The full binary tree theorem states “the number of leaves in an empty full binary tree is one more than the number of internal nodes”
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 3
Correct
Mark 1.00 out of 1.00
Flag question
Question text
The process for visiting all of the nodes of a binary tree in some order is called a traversal.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 4
Correct
Mark 1.00 out of 1.00
Flag question
Question text
A full binary tree has a restricted shape which starts at the root and fills the tree by levels from left to right.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 5
Correct
Mark 1.00 out of 1.00
Flag question
Question text
A binary tree traversal that lists every node in the tree exactly once is called:
Select one:
a. a Traversal
b. A visitor design pattern
c. An enumeration
d. Natural ordering sequence
Feedback
The correct answer is: An enumeration
Question 6
Correct
Mark 1.00 out of 1.00
Flag question
Question text
A preorder traversal visits every node starting at the leaf nodes and working up the tree.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 7
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Correctly identify the following heap structure by selecting the best answer:

Select one:
a. partially ordered heap
b. max-heap structure
c. priority heap
d. min-heap structure
Feedback
The correct answer is: max-heap structure
Question 8
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select the answer that best defines Huffman Coding:
Select one:
a. A set of coding rules that is typically used for compression
b. A fixed length coding scheme for character representation
c. A tree structure that trades off space and time requirements to provide a more efficient priority queue
d. An approach of assigning codes to characters such that the frequency length of the code depends upon the relative frequency of the corresponding character in use
Feedback
The correct answer is: An approach of assigning codes to characters such that the frequency length of the code depends upon the relative frequency of the corresponding character in use
Question 9
Correct
Mark 1.00 out of 1.00
Flag question
Question text
The depth of node H in the following tree is:

Select one:
a. 3
b. 2
c. 4
d. 1
Feedback
The correct answer is: 3
Question 10
Correct
Mark 1.00 out of 1.00
Flag question
Question text
According to textbook by Shaffer, a heap data structure has two properties which are:
Select one:
a. every node stores a value less than or equal to that of its children and it is a complete binary tree
b. it is a min-heap and is partially ordered
c. it is a complete binary tree and the values stored in it are partially ordered
d. it is a priority queue and is in Θ( n )
Feedback
The correct answer is: it is a complete binary tree and the values stored in it are partially ordered
Top of Form
A finite set of one or more nodes such that there is one designated node call the root is a: (select the best answer)
Select one:
a. Parent root
b. a B+ tree data structure
c. Index
d. Tree
Feedback
The correct answer is: Tree
Question 2
Correct
Mark 1.00 out of 1.00
Flag question
Question text
A collection of one or more trees is called:
Select one:
a. Trees
b. Multiple Spanning Trees
c. a Forest
d. Traversals
Feedback
The correct answer is: a Forest
Question 3
Correct
Mark 1.00 out of 1.00
Flag question
Question text
The process of determining if two objects are in the same set and then merging those sets is called:
Select one:
a. a Union Operation
b. Union / Find
c. a Weighted Union
d. a Merge Operation
Feedback
The correct answer is: Union / Find
Question 4
Correct
Mark 1.00 out of 1.00
Flag question
Question text
A traversal of a general tree that traverses the roots subtrees from left to right, then visits the root is called a preorder traversal.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 5
Correct
Mark 1.00 out of 1.00
Flag question
Question text
A method that is designed to create extremely shallow trees is called:
Select one:
a. Dynamic node implementation
b. Union/Find
c. The list of children method
d. Path compression
Feedback
The correct answer is: Path compression
Question 6
Correct
Mark 1.00 out of 1.00
Flag question
Question text
A tree whose internal nodes all have exactly K children is called a K-ary tree.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 7
Correct
Mark 1.00 out of 1.00
Flag question
Question text
An important advantage of the sequential tree implementation is that (select the best answer):
Select one:
a. It is an extremely shallow tree
b. The data structure can be transmitted between computers
c. It saves space because no pointers are stored
d. It uses dynamic nodes
Feedback
The correct answer is: It saves space because no pointers are stored
Question 8
Correct
Mark 1.00 out of 1.00
Flag question
Question text
A sequential tree can be represented using a bit vector?
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 9
Correct
Mark 1.00 out of 1.00
Flag question
Question text
The list of children approach uses both pointers and an array structure to represent the tree.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 10
Correct
Mark 1.00 out of 1.00
Flag question
Question text
The weighted union rule joins a tree with fewer nodes to a tree with more nodes by making the smaller tree’s root point to the root of the larger tree.
Select one:
True
False
Feedback
The correct answer is 'True'.
Bottom of Form
Top of Form
The best asymptotic analysis for the selection sort is represented by (select the best option):
Option 1. O( n log n )
Option 2. Ω( n2 )
Option 3. O( n2 )
Option 4. Θ( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
The correct answer is: Option 4
Question 2
Correct
Mark 1.00 out of 1.00
Flag question
Question text
A sort algorithm that uses two nested loops with the inner loop moving through the array from bottom to top is called the:
Select one:
a. Insertion sort
b. Bubble sort
c. Inversion sort
d. Selection sort
Feedback
The correct answer is: Bubble sort
Question 3
Correct
Mark 1.00 out of 1.00
Flag question
Question text
A sort that features a limit of n-1 of record swaps is called:
Select one:
a. Insertion sort
b. Bubble sort
c. Inversion sort
d. Selection sort
Feedback
The correct answer is: Selection sort
Question 4
Correct
Mark 1.00 out of 1.00
Flag question
Question text
An exchange sort is one where: (select the best answer)
Select one:
a. Records in an unsorted list are moved to a sorted list
b. Adjacent records in the list and compared and exchanged
c. An inversion is executed
d. The sorting algorithm is said to be stable
Feedback
The correct answer is: Adjacent records in the list and compared and exchanged
Question 5
Correct
Mark 1.00 out of 1.00
Flag question
Question text
A sort where the list is divided into halves, the halves sorted and these two halves are merged is called:
Select one:
a. Mergesort
b. Binary sort
c. Quicksort
d. Heapsort
Feedback
The correct answer is: Mergesort
Question 6
Correct
Mark 1.00 out of 1.00
Flag question
Question text
The benefit of a quicksort is that it provides excellent performance in both the average and worst case:
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 7
Correct
Mark 1.00 out of 1.00
Flag question
Question text
What is the role of the pivot in a quicksort algorithm?
Select one:
a. It identifies the maxkey value
b. It specifies the point where the array will be subdivided into partitions and each partition then sorted
c. It defines the sequence for merging in the sort
d. It indicates the index of the current record being compared
Feedback
The correct answer is: It specifies the point where the array will be subdivided into partitions and each partition then sorted
Question 8
Correct
Mark 1.00 out of 1.00
Flag question
Question text
A sorting algorithm that assigns records to bins and then relies on some other sorting technique to sort the records within each bin called:
Select one:
a. Radix Sort
b. Quicksort
c. Hash sort
d. Bucket sort
Feedback
The correct answer is: Bucket sort
Question 9
Correct
Mark 1.00 out of 1.00
Flag question
Question text
The processing time or cost of a sort is defined by the number of comparisons and exchanges that must be made during processing. What is the average cost of the heapsort?:
Option 1. O( n log n )
Option 2. Ω( n2 )
Option 3. O( n2 )
Option 4. Θ( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
The correct answer is: Option 1
Question 10
Correct
Mark 1.00 out of 1.00
Flag question
Question text
The quicksort is typically slower than the heapsort by a constant factor.
Select one:
True
False
Feedback
The correct answer is 'False'.
Bottom of Form
Setting the dirty bit causes what action to be performed on a block: (select the best answer)
Select one:
a. It is deleted because it is no longer consistent
b. It flushes or writes the block out to the disk
c. Refreshes the data by re-reading the block
d. It cleans the cache by flushing all data from the cache
Feedback
The correct answer is: It flushes or writes the block out to the disk
Question 2
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Which of the following is NOT one of the buffer pool heuristics defined in the text : (select the best answer)
Select one:
a. FIFO
b. LIFO
c. LRU
d. LFU
Feedback
The correct answer is: LIFO
Question 3
Correct
Mark 1.00 out of 1.00
Flag question
Question text
A technique that allows a programmer to use more main memory than exists in the computer is called: (select the best answer)
Select one:
a. Buffer cache
b. Random access memory
c. Secondary storage
d. Virtual memory
Feedback
The correct answer is: Virtual memory
Question 4
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Internal Fragmentation refers to: (select the best answer)
Select one:
a. Space that is left empty because records do not fit evenly into a sector
b. Space allocated to a file that is not physically adjacent on the disk drive
c. Space that is left empty because records do not fit evenly into a sector or Space allocated to a file that is not physically adjacent
d. None of the options
Feedback
The correct answer is: Space that is left empty because records do not fit evenly into a sector or Space allocated to a file that is not physically adjacent
Question 5
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Data is stored within the disk drive on the: (select the best answer)
Select one:
a. Spindle
b. Platter
c. Cylinder
d. Sector
Feedback
The correct answer is: Platter
Question 6
Incorrect
Mark 0.00 out of 1.00
Flag question
Question text
The process of storing blocks of data in main memory after reading from disk is referred to as:
Select one:
a. Buffering
b. Hashing
c. Pooling
d. Indexing
Feedback
The correct answer is: Buffering
Question 7
Correct
Mark 1.00 out of 1.00
Flag question
Question text
A characteristic of RAM (random access memory) is that it is persistent and is not lost when the power to a computer is turned off.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 8
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Secondary storage is characterized by the following:
Select one:
a. It is persistent
b. It is faster than primary storage
c. It is volatile
d. It is more expensive than primary storage
Feedback
The correct answer is: It is persistent
Question 9
Incorrect
Mark 0.00 out of 1.00
Flag question
Question text
An algorithm that breaks a file to be sorted in smaller files called runs which are sorted and eventually put back together resulting in a sorted file is called:
Select one:
a. Quicksort algorithm
b. Replacement sort algorithm
c. An indexed key sort algorithm
d. Mergesort algorithm
Feedback
The correct answer is: Mergesort algorithm
Question 10
Incorrect
Mark 0.00 out of 1.00
Flag question
Question text
A significant benefit to using an index to hold and sort keys to a file is:
Select one:
a. Smaller keys require less I/O
b. The entire sort can always be completed in memory
c. The head of the disk drive does not need to move
d. There is no seek time added to the latency of I/O operations
Feedback
The correct answer is: Smaller keys require less I/O
Top of Form
Which of the following is not one of the general approaches to search algorithms:
Select one:
a. Buffer cache access methods
b. Sequential and list methods
c. Direct access by key value (hashing)
d. Tree indexing methods
Feedback
The correct answer is: Buffer cache access methods
Question 2
Correct
Mark 1.00 out of 1.00
Flag question
Question text
A list that organizes the order of records within the list based upon patterns of actual record access is called a/an (select the best answer):
Select one:
a. Quadratic Binary search order
b. A Zipf Distribution
c. A Self-organizing list
d. A range query
Feedback
The correct answer is: A Self-organizing list
Question 3
Correct
Mark 1.00 out of 1.00
Flag question
Question text
A compound computed search that combines a binary search to get close to the required record and then uses sequential search to find the item is referred to as a/an:
Select one:
a. Zipf search
b. An Exact match search
c. A Dictionary search
d. bit map vector search
Feedback
The correct answer is: A Dictionary search
Question 4
Correct
Mark 1.00 out of 1.00
Flag question
Question text
A coding scheme that replaces repeated occurrences of strings with a pointer to the location in the file of the first occurrence of the string is called Ziv-Lempel coding.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 5
Correct
Mark 1.00 out of 1.00
Flag question
Question text
The process of storing records in the order that they were added to a file is called:
Select one:
a. Entry-sequenced file
b. Binary Sequenced file
c. LIFO file format
d. Tombstone approach
Feedback
The correct answer is: Entry-sequenced file
Question 6
Correct
Mark 1.00 out of 1.00
Flag question
Question text
The process of associating a key with the location of a corresponding data record is called folding.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 7
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Each record of a database normally has a unique identifier called the:
Select one:
a. Secondary Key
b. Primary index
c. Primary key
d. Index key
Feedback
The correct answer is: Primary key
Question 8
Correct
Mark 1.00 out of 1.00
Flag question
Question text
A linear index is an index file organized as a sequence of key/pointer pairs where the keys are in a sorter order.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 9
Correct
Mark 1.00 out of 1.00
Flag question
Question text
A tree data structure whose shape obeys the following definition,
o A node contains one or two keys
o Every internal node has either 2 children if it contains 1 key or 3 children if it contains two keys
o All leaves are at the same level in the tree
Is called a/an:
Select one:
a. B*-Tree
b. BST
c. B+-Tree
d. 2-3 tree
Feedback
The correct answer is: 2-3 tree
Question 10
Correct
Mark 1.00 out of 1.00
Flag question
Question text
The most significant difference between the B+-Tree and the BST is that the B+-Tree stores records only at the leaf nodes.
Select one:
True
False
Feedback
The correct answer is 'True'.
Bottom of Form
A traversal that visits the left subtree, then the node, and then the right subtree is called:

Select one:
a. Preorder Traversal
b. Postorder Traversal
c. Inorder Traversal
d. Outoforder Traversal
Feedback
The correct answer is: Inorder Traversal
Question 2
Not answered
Marked out of 1.00
Flag question
Question text
Each record of a database normally has a unique identifier called the:
Select one:
a. Secondary Key
b. Primary index
c. Primary key
d. Index key
Feedback
The correct answer is: Primary key
Question 3
Not answered
Marked out of 1.00
Flag question
Question text
An ADT is:
Select one:
a. A type together with a collection of operations to manipulate the type
b. An implementation of a flyweight design pattern
c. The realization of a data type as a software component
d. An implementation in java of a class for a data type
Feedback
The correct answer is: The realization of a data type as a software component
Question 4
Not answered
Marked out of 1.00
Flag question
Question text
A linked list creates order through the use of pointers that link one element to another.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 5
Not answered
Marked out of 1.00
Flag question
Question text
The most significant difference between the B+-Tree and the BST is that the B+-Tree stores records only at the leaf nodes.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 6
Not answered
Marked out of 1.00
Flag question
Question text
A sequential tree can be represented using a bit vector?
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 7
Not answered
Marked out of 1.00
Flag question
Question text
In linked lists there are no NULL links in:
Select one:
a. Single linked list
b. Linear doubly linked list
c. Circular linked list
d. None of these
Feedback
The correct answer is: Circular linked list
Question 8
Not answered
Marked out of 1.00
Flag question
Question text
Recursion is when an algorithm uses a series of loop structures to repeat an operation until the answer has been computed.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 9
Not answered
Marked out of 1.00
Flag question
Question text
A linked list implementation relies upon static memory allocation where static refers to the requirement to pre-allocate all of the memory that will be used for the list.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 10
Not answered
Marked out of 1.00
Flag question
Question text
The process of storing records in the order that they were added to a file is called:
Select one:
a. Entry-sequenced file
b. Binary Sequenced file
c. LIFO file format
d. Tombstone approach
Feedback
The correct answer is: Entry-sequenced file
Question 11
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
static int function ( n ) {
for (k=0; k<n; k++)
A[k] = k;
return A[k];
}
Choice 1. O ( n2 )
Choice 2. O( 2n )
Choice 3. Ω( n2 )
Choice 4. Θ ( n )
(NOTE: code fragment is not intended to be functioning code)

Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 4
Question 12
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the option that represents the most appropriate asymptotic analysis:
for (int i = 0; i < a.length; i++) {
System.out.println(a[i]);
}
Option 1. O( n )
Option 2. O( 2n )
Option 3. O( n log n )
Option 4. O( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
The correct answer is: Option 1
Question 13
Not answered
Marked out of 1.00
Flag question
Question text
Inserting or removing an item at position n-1 within a linked list has the same cost in terms  ( n ) time as the same operation in an array based implementation of a list.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 14
Not answered
Marked out of 1.00
Flag question
Question text
Which of the following is NOT one of the buffer pool heuristics defined in the text : (select the best answer)
Select one:
a. FIFO
b. LIFO
c. LRU
d. LFU
Feedback
The correct answer is: LIFO
Question 15
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the option that represents the most appropriate asymptotic analysis:
for (int i = 1; i <= n; i *= 2) {
for (int j = 0; j < n; j++) {
count++;
}
}
Option 1. O( 1 )
Option 2. O( 2n )
Option 3. O( n log n )
Option 4. O( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
Explanation: Here the outer loop is done log n times and the inner loop is done n times, so T(n) = n log n. (Note that the default base for logarithms in Computer Science is 2.)
The correct answer is: Option 3
Question 16
Not answered
Marked out of 1.00
Flag question
Question text
The full binary tree theorem states “the number of leaves in an empty full binary tree is one more than the number of internal nodes”
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 17
Not answered
Marked out of 1.00
Flag question
Question text
The processing time or cost of a sort is defined by the number of comparisons and exchanges that must be made during processing. What is the average cost of the heapsort?:
Option 1. O( n log n )
Option 2. Ω( n2 )
Option 3. O( n2 )
Option 4. Θ( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
The correct answer is: Option 1
Question 18
Not answered
Marked out of 1.00
Flag question
Question text
When big-Oh and  coincide, we indicate this by using (select the best answer):
1. Big Oh (O)
2. Big Omega (Ω)
3. Big Theta (Θ)
4. Exponential growth
Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 3
Question 19
Not answered
Marked out of 1.00
Flag question
Question text
A list is said to be empty when all of its elements have a zero (0) value
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 20
Not answered
Marked out of 1.00
Flag question
Question text
True/False: Big Theta (Θ) indicates that the Upper and Lower bounds of an algorithm are the same.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 21
Not answered
Marked out of 1.00
Flag question
Question text
A traversal of a general tree that traverses the roots subtrees from left to right, then visits the root is called a preorder traversal.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 22
Not answered
Marked out of 1.00
Flag question
Question text
Enqueue and Dequeue are notations associated with which data structure:
Select one:
a. Queue
b. Stack
c. List
d. Array
Feedback
The correct answer is: Queue
Question 23
Not answered
Marked out of 1.00
Flag question
Question text
A significant benefit to using an index to hold and sort keys to a file is:
Select one:
a. Smaller keys require less I/O
b. The entire sort can always be completed in memory
c. The head of the disk drive does not need to move
d. There is no seek time added to the latency of I/O operations
Feedback
The correct answer is: Smaller keys require less I/O
Question 24
Not answered
Marked out of 1.00
Flag question
Question text
A tree whose internal nodes all have exactly K children is called a K-ary tree.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 25
Not answered
Marked out of 1.00
Flag question
Question text
Which of the following is not a characteristic of an algorithm?
Select one:
a. It must be correct
b. It must be composed of concrete steps
c. It can have no ambiguity
d. It must be composed of an infinite number of steps.
Feedback
The correct answer is: It must be composed of an infinite number of steps.
Question 26
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the most appropriate asymptotic analysis:
// Towers of Hanoi
static void solveHanoi(int disks, char fromPole, char toPole, char withPole) {
if (disks >= 1) {
solveHanoi(disks-1, fromPole, withPole, toPole);
moveDisk(fromPole, toPole);
solveHanoi(disks-1, withPole, toPole, fromPole);
}
}
static void moveDisk(char fromPole, char toPole) {
moves++;
}
Option 1. O( n )
Option 2. O( 2n )
Option 3. O( n log n )
Option 4. O( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
The correct answer is: Option 2
Question 27
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the option which represents the most appropriate asymptotic analysis:
static int function ( n ) {
sum = 0;
for (i=1; i<=n; i++)
sum += n;
return sum;
}
Option 1. Ω( n2 )
Option 2. Θ ( n )
Option 3. O( log n )
Option 4. O( 2n )
(NOTE: code fragment is not intended to be functioning code)


Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 2
Question 28
Not answered
Marked out of 1.00
Flag question
Question text
True/False: There is always one most efficient algorithm to solve a particular problem.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 29
Not answered
Marked out of 1.00
Flag question
Question text
A technique that allows a programmer to use more main memory than exists in the computer is called: (select the best answer)
Select one:
a. Buffer cache
b. Random access memory
c. Secondary storage
d. Virtual memory
Feedback
The correct answer is: Virtual memory
Question 30
Not answered
Marked out of 1.00
Flag question
Question text
A sort that features a limit of n-1 of record swaps is called:
Select one:
a. Insertion sort
b. Bubble sort
c. Inversion sort
d. Selection sort
Feedback
The correct answer is: Selection sort
Question 31
Not answered
Marked out of 1.00
Flag question
Question text
A traversal that visits each node before visiting its children is called:
Select one:
a. Preorder traversal
b. Postorder traversal
c. Inorder Traversal
d. Outoforder Traversal
Feedback
The correct answer is: Preorder traversal
Question 32
Not answered
Marked out of 1.00
Flag question
Question text
A list that organizes the order of records within the list based upon patterns of actual record access is called a/an (select the best answer):
Select one:
a. Quadratic Binary search order
b. A Zipf Distribution
c. A Self-organizing list
d. A range query
Feedback
The correct answer is: A Self-organizing list
Question 33
Not answered
Marked out of 1.00
Flag question
Question text
True/False: The stack data structure is implemented as a LIFO structure (last in first out)
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 34
Not answered
Marked out of 1.00
Flag question
Question text
The process of determining if two objects are in the same set and then merging those sets is called:
Select one:
a. a Union Operation
b. Union / Find
c. a Weighted Union
d. a Merge Operation
Feedback
The correct answer is: Union / Find
Question 35
Not answered
Marked out of 1.00
Flag question
Question text
A sort algorithm that uses two nested loops with the inner loop moving through the array from bottom to top is called the:
Select one:
a. Insertion sort
b. Bubble sort
c. Inversion sort
d. Selection sort
Feedback
The correct answer is: Bubble sort
Question 36
Not answered
Marked out of 1.00
Flag question
Question text
Which of the following is NOT one of the design patterns outlined in our text.
Select one:
a. Flyweight
b. Visitor
c. Composite
d. Synergy
Feedback
The correct answer is: Synergy
Question 37
Not answered
Marked out of 1.00
Flag question
Question text
Push and Pop are notations associated with which data structure:
Select one:
a. Queue
b. Stack
c. List
d. Array
Feedback
The correct answer is: Stack
Question 38
Not answered
Marked out of 1.00
Flag question
Question text
The process of associating a key with the location of a corresponding data record is called folding.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 39
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the option that represents the most appropriate asymptotic analysis:
// Recursive Fibonacci generator
static long fibr(int n) {
if ((n == 1) || (n == 2)) return 1; // Base case
return fibr(n-1) + fibr(n-2); // Recursive call
}
Option 1. O( n )
Option 2. O( 2n )
Option 3. O( n log n )
Option 4. O( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
The correct answer is: Option 2
Question 40
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
static int function ( n ) {
for (k=0; k<n; k++)
A[k] = k;
return A[k];
}
Choice 1. Θ ( n log n )
Choice 2. O( 2n )
Choice 3. O( n )
Choice 4. Ω( n2 )
(NOTE: code fragment is not intended to be functioning code)



Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 3
Question 41
Not answered
Marked out of 1.00
Flag question
Question text
Which of the following is not one of the general approaches to search algorithms:
Select one:
a. Buffer cache access methods
b. Sequential and list methods
c. Direct access by key value (hashing)
d. Tree indexing methods
Feedback
The correct answer is: Buffer cache access methods
Question 42
Not answered
Marked out of 1.00
Flag question
Question text
The weighted union rule joins a tree with fewer nodes to a tree with more nodes by making the smaller tree’s root point to the root of the larger tree.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 43
Not answered
Marked out of 1.00
Flag question
Question text
The list of children approach uses both pointers and an array structure to represent the tree.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 44
Not answered
Marked out of 1.00
Flag question
Question text
The depth of node H in the following tree is:

Select one:
a. 3
b. 2
c. 4
d. 1
Feedback
The correct answer is: 3
Question 45
Not answered
Marked out of 1.00
Flag question
Question text
Data is stored within the disk drive on the: (select the best answer)
Select one:
a. Spindle
b. Platter
c. Cylinder
d. Sector
Feedback
The correct answer is: Platter
Question 46
Not answered
Marked out of 1.00
Flag question
Question text
The most time consuming of the following operations on an array based list implementation is:
Select one:
a. Inserting a new element at position n-1 in the list where n is the number of elements in the list.
b. Inserting a new element into the head of the list.
c. Removing an element at position n-1 within the list
d. Removing an element from the tail of the list.
Feedback
The correct answer is: Inserting a new element into the head of the list.
Question 47
Not answered
Marked out of 1.00
Flag question
Question text
If A={1, 2, 3, 4} and B={4, 5, 6}, find A∪ B .
Select one:
a. {1,2,3,4,4,5,6}
b. {4}
c. {x | x is all positive integers}
d. {1,2,3,4,5,6}
Feedback
The correct answer is: {1,2,3,4,5,6}
Question 48
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the option which represents the most appropriate asymptotic analysis:
/** @return Position of largest value in "A“ */
static int largest(int[] A) {
int currlarge = 0; // Position of largest
for (int i=1; i<A.length; i++)
if (A[currlarge] < A[i])
currlarge = i; // Remember pos
return currlarge; // Return largest pos
}

Choice 1. Θ ( n )
Choice 2. O( 2n )
Choice 3. Θ( n log n )
Choice 4. Ω( n2 )
(NOTE: code fragment is not intended to be functioning code)

Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 1
Question 49
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
function ( n ) {
sum1 = 0;
for (k=1; k<=n; k*=2)
for (j=1; j<=n; j++)
sum1++;
}
Choice 1. Θ ( n )
Choice 2. O( 2n )
Choice 3. Θ( n log n )
Choice 4. Ω( n2 )
(NOTE: code fragment is not intended to be functioning code)

Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 3
Question 50
Not answered
Marked out of 1.00
Flag question
Question text
The implementation of a data type as a data structure is the physical form of an ADT.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 51
Not answered
Marked out of 1.00
Flag question
Question text
An exchange sort is one where: (select the best answer)
Select one:
a. Records in an unsorted list are moved to a sorted list
b. Adjacent records in the list and compared and exchanged
c. An inversion is executed
d. The sorting algorithm is said to be stable
Feedback
The correct answer is: Adjacent records in the list and compared and exchanged
Question 52
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
static int function ( n ) {
sum = 0;
for (j=1; j<=n; j++)
for (i=1; i<=j; i++)
sum++;
return sum;
}
Choice 1. Θ ( n )
Choice 2. O( 2n )
Choice 3. Θ( n2 )
Choice 4. Ω( n2 )
(NOTE: code fragment is not intended to be functioning code)


Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 3
Question 53
Not answered
Marked out of 1.00
Flag question
Question text
An important advantage of the sequential tree implementation is that (select the best answer):
Select one:
a. It is an extremely shallow tree
b. The data structure can be transmitted between computers
c. It saves space because no pointers are stored
d. It uses dynamic nodes
Feedback
The correct answer is: It saves space because no pointers are stored
Question 54
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
function ( n ) {
sum1 = 0;
for (i=1; i<=n; i++)
for (j=1; j<=n; j++)
sum1++;
}
Choice 1. Θ ( n2 )
Choice 2. O( 2n )
Choice 3. Θ( n log n )
Choice 4. Ω( log n2 )
(NOTE: code fragment is not intended to be functioning code)

Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 1
Question 55
Not answered
Marked out of 1.00
Flag question
Question text
A sort where the list is divided into halves, the halves sorted and these two halves are merged is called:
Select one:
a. Mergesort
b. Binary sort
c. Quicksort
d. Heapsort
Feedback
The correct answer is: Mergesort
Question 56
Not answered
Marked out of 1.00
Flag question
Question text
A traversal that visits each node after visiting its children is called:
Select one:
a. Preorder Traversal
b. Postorder Traversal
c. Inorder Traversal
d. Outoforder Traversal
Feedback
The correct answer is: Postorder Traversal
Question 57
Not answered
Marked out of 1.00
Flag question
Question text
The process for visiting all of the nodes of a binary tree in some order is called a traversal.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 58
Not answered
Marked out of 1.00
Flag question
Question text
A collection of one or more trees is called:
Select one:
a. Trees
b. Multiple Spanning Trees
c. a Forest
d. Traversals
Feedback
The correct answer is: a Forest
Question 59
Not answered
Marked out of 1.00
Flag question
Question text
The upper bound for the growth of the Algorithms running time is represented by (please select the best answer):
1. Big Oh (O)
2. Big Omega (Ω)
3. Big Theta (Θ)
4. Exponential growth
Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 1
Question 60
Not answered
Marked out of 1.00
Flag question
Question text
Which of the following is not a mathematical proof technique?
Select one:
a. Proof by mathematical induction
b. Proof by contradiction
c. Direct proof
d. Proof by consensus
Feedback
The correct answer is: Proof by consensus
Question 61
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the option that represents the most appropriate asymptotic analysis:
public static int binarySearch(int[] a, int key) {
int left = 0;
int right = a.length-1;
while (left <= right) {
int mid = left + (right-left)/2;
if (key < a[mid]) right = mid-1;
else if (key > a[mid]) left = mid+1;
else return mid;
}
//not found
return -1;
}
Option 1. Ω( 1 ), O( log n )
Option 2. Ω( n ), O( 2n )
Option 3. Θ( n log n )
Option 4. Θ( log n )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
The correct answer is: Option 1
Question 62
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
static int function ( n ) {
sum = 0;
for (i=1; i<=n; i++)
sum += n;
return sum;
}
Choice 1. Ω( n2 )
Choice 2. Ω( log n2 )
Choice 3. Θ( n log n )
Choice 4. O ( n )
(NOTE: code fragment is not intended to be functioning code)



Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 4
Question 63
Not answered
Marked out of 1.00
Flag question
Question text
Which of the following is NOT true for Linked Lists structures (please select the best choice):
Choice 1. Insertion and deletion are ( 1 ).
Choice 2. Direct access of an item in the list structure is ( n ).
Choice 3. Space grows with number of elements.
Choice 4. There is no overhead associated with elements in the list structure
Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 4
Question 64
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
function ( n ) {
sum2 = 0;
for (i=1; i<=n; i++)
for (j=1; j<=i; j++)
sum2++;
}
}
Choice 1. Ω ( 1 )
Choice 2. O( 2n )
Choice 3. Θ( n2 )
Choice 4. Ω( n2 )
(NOTE: code fragment is not intended to be functioning code)

Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 3
Question 65
Not answered
Marked out of 1.00
Flag question
Question text
Which of the following items is NOT true for Array-Based Lists (please select the best choice):
Choice 1. Insertion and deletion operations are ( n )
Choice 2. Direct access of an item in the array is ( 1 )
Choice 3. Space used grows dynamically as the array is populated
Choice 4. Array contains wasted space if array positions are not full
Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 3
Question 66
Not answered
Marked out of 1.00
Flag question
Question text
A method that is designed to create extremely shallow trees is called:
Select one:
a. Dynamic node implementation
b. Union/Find
c. The list of children method
d. Path compression
Feedback
The correct answer is: Path compression
Question 67
Not answered
Marked out of 1.00
Flag question
Question text
The process of storing blocks of data in main memory after reading from disk is referred to as:
Select one:
a. Buffering
b. Hashing
c. Pooling
d. Indexing
Feedback
The correct answer is: Buffering
Question 68
Not answered
Marked out of 1.00
Flag question
Question text
A solution is said to be efficient if it:
Select one:
a. Solves the problem within the required resource constraints
b. Executes faster than other solutions
c. Is completed in the fewest number of steps
d. Can be explained in the context of Big-Oh notation
Feedback
The correct answer is: Solves the problem within the required resource constraints
Question 69
Not answered
Marked out of 1.00
Flag question
Question text
A sorting algorithm that assigns records to bins and then relies on some other sorting technique to sort the records within each bin called:
Select one:
a. Radix Sort
b. Quicksort
c. Hash sort
d. Bucket sort
Feedback
The correct answer is: Bucket sort
Question 70
Not answered
Marked out of 1.00
Flag question
Question text
In a stack which option would access the 3rd element from the top of the stack S
Option 1. S.push(-1);
Option 2. S.dequeue(-3);
Option 3. S.pop();
S.pop();
S.pop();
Option 4. S.pop(n-3);
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
The correct answer is: Option 3
Question 71
Not answered
Marked out of 1.00
Flag question
Question text
A leaf is any node that:
Select one:
a. Has one child
b. Is an internal node with no ancestors
c. Is any node with two empty children
d. Is the ancestor of the root node
Feedback
The correct answer is: Is any node with two empty children
Question 72
Not answered
Marked out of 1.00
Flag question
Question text
According to textbook by Shaffer, a heap data structure has two properties which are:
Select one:
a. every node stores a value less than or equal to that of its children and it is a complete binary tree
b. it is a min-heap and is partially ordered
c. it is a complete binary tree and the values stored in it are partially ordered
d. it is a priority queue and is in Θ( n )
Feedback
The correct answer is: it is a complete binary tree and the values stored in it are partially ordered
Question 73
Not answered
Marked out of 1.00
Flag question
Question text
The upper bound for the growth of the Algorithms running time is represented by:
Select one:
a. Big Oh (O)
b. Big Omega (Ω)
c. Big Theta (Θ)
d. Exponential growth
Feedback
The correct answer is: Big Oh (O)
Question 74
Not answered
Marked out of 1.00
Flag question
Question text
The lower bound for the growth of the Algorithms running time is represented by (please the best answer):
1. Big Oh (O)
2. Big Omega (Ω)
3. Big Theta (Θ)
4. Exponential growth
Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 2
Question 75
Not answered
Marked out of 1.00
Flag question
Question text
The benefit of a quicksort is that it provides excellent performance in both the average and worst case:
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 76
Not answered
Marked out of 1.00
Flag question
Question text
The best asymptotic analysis for the selection sort is represented by (select the best option):
Option 1. O( n log n )
Option 2. Ω( n2 )
Option 3. O( n2 )
Option 4. Θ( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
The correct answer is: Option 4
Question 77
Not answered
Marked out of 1.00
Flag question
Question text
A finite set of one or more nodes such that there is one designated node call the root is a: (select the best answer)
Select one:
a. Parent root
b. a B+ tree data structure
c. Index
d. Tree
Feedback
The correct answer is: Tree
Question 78
Not answered
Marked out of 1.00
Flag question
Question text
True/False: The queue data structure is implemented as FIFO structure (first in first out)
:
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 79
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
function ( n ) {
sum2 = 0;
for (k=1; k<=n; k*=2)
for (j=1; j<=k; j++)
sum2++;
}
Choice 1. O( 2n )
Choice 2. Θ ( n )
Choice 3. Θ( n log n )
Choice 4. Ω( n2 )
(NOTE: code fragment is not intended to be functioning code)

Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 2
Question 80
Not answered
Marked out of 1.00
Flag question
Question text
A coding scheme that replaces repeated occurrences of strings with a pointer to the location in the file of the first occurrence of the string is called Ziv-Lempel coding.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 81
Not answered
Marked out of 1.00
Flag question
Question text
In a queue, placing new items in the queue is referred to as a push and taking an item out of the queue is called a pop.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 82
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the option that represents the most appropriate asymptotic analysis:
if (a.length > 0) {
return a[a.length - 1];
} else {
throw new NoSuchElementException();
}
Option 1. O( 1 )
Option 2. O( 2n )
Option 3. O( n log n )
Option 4. O( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
Explanation: Here n = a.length, and T(n) = 1.
The correct answer is: Option 1
Question 83
Not answered
Marked out of 1.00
Flag question
Question text
Setting the dirty bit causes what action to be performed on a block: (select the best answer)
Select one:
a. It is deleted because it is no longer consistent
b. It flushes or writes the block out to the disk
c. Refreshes the data by re-reading the block
d. It cleans the cache by flushing all data from the cache
Feedback
The correct answer is: It flushes or writes the block out to the disk
Question 84
Not answered
Marked out of 1.00
Flag question
Question text
Asymptotic Algorithm Analysis is primarily concerned with:
Select one:
a. The size of the constant in the algorithm running time equation
b. The speed of the computing running the algorithm
c. The speed of the compiler
d. The growth rate demonstrated in the algorithm running time equation
Feedback
The correct answer is: The growth rate demonstrated in the algorithm running time equation
Question 85
Not answered
Marked out of 1.00
Flag question
Question text
Correctly identify the following heap structure by selecting the best answer:

Select one:
a. partially ordered heap
b. max-heap structure
c. priority heap
d. min-heap structure
Feedback
The correct answer is: max-heap structure
Question 86
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select option that represents the most appropriate asymptotic analysis:
for (i=0; i<n; i++) {
//
// Search in array a for smallest element starting at i to n-1
//
minIndex = findSmallestElement(a, i, n-1)
a[i] = a[minIndex];
}
findSmallestElement( int a[], int i, int n ) {
int largest = a[i];
while(i<n) {
if(a[i] >a[largest])
largest = i;
i++;
}
return(largest);
}
Option 1. O( n )
Option 2. O( 2n )
Option 3. O( n log n )
Option 4. O( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
index-of-smallest element in a[i..j] takes j-i+1 operations
• n + (n-1) + (n-2) + (n-3) + ... + 3 + 2 + 1
• this is n2
The correct answer is: Option 4
Question 87
Not answered
Marked out of 1.00
Flag question
Question text
An algorithm that breaks a file to be sorted in smaller files called runs which are sorted and eventually put back together resulting in a sorted file is called:
Select one:
a. Quicksort algorithm
b. Replacement sort algorithm
c. An indexed key sort algorithm
d. Mergesort algorithm
Feedback
The correct answer is: Mergesort algorithm
Question 88
Not answered
Marked out of 1.00
Flag question
Question text
A list is
Select one:
a. An ADT for storing and retrieving data
b. A tree data structure
c. Finite ordered sequence of data items
d. A collection of operations to implement an ADT
Feedback
The correct answer is: Finite ordered sequence of data items
Question 89
Not answered
Marked out of 1.00
Flag question
Question text
Select the answer that best defines Huffman Coding:
Select one:
a. A set of coding rules that is typically used for compression
b. A fixed length coding scheme for character representation
c. A tree structure that trades off space and time requirements to provide a more efficient priority queue
d. An approach of assigning codes to characters such that the frequency length of the code depends upon the relative frequency of the corresponding character in use
Feedback
The correct answer is: An approach of assigning codes to characters such that the frequency length of the code depends upon the relative frequency of the corresponding character in use
Question 90
Not answered
Marked out of 1.00
Flag question
Question text
True/False: Big Theta (Θ) indicates that the Upper and Lower bounds of an algorithm are the same.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 91
Not answered
Marked out of 1.00
Flag question
Question text
The quicksort is typically slower than the heapsort by a constant factor.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 92
Not answered
Marked out of 1.00
Flag question
Question text
Secondary storage is characterized by the following:
Select one:
a. It is persistent
b. It is faster than primary storage
c. It is volatile
d. It is more expensive than primary storage
Feedback
The correct answer is: It is persistent
Question 93
Not answered
Marked out of 1.00
Flag question
Question text
A compound computed search that combines a binary search to get close to the required record and then uses sequential search to find the item is referred to as a/an:
Select one:
a. Zipf search
b. An Exact match search
c. A Dictionary search
d. bit map vector search
Feedback
The correct answer is: A Dictionary search
Question 94
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
static int function ( n ) {
sum = 0;
for (i=1; i<=n; i++)
sum += n;
return sum;
}
Choice 1. Ω( n2 )
Choice 2. Θ ( n2 )
Choice 3. O( log n )
Choice 4. O( n )
(NOTE: code fragment is not intended to be functioning code)


Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 4
Question 95
Not answered
Marked out of 1.00
Flag question
Question text
According to the properties of logarithms, log(nm) =
Note: Due to issues with HTML formatting, an exponent is represented by preceding it with the ^ symbol. As such x^2 is equivalent to x2.
Select one:
a. log n – log m
b. n log n
c. log n + log m
d. log(n^m)
Feedback
The correct answer is: log n + log m
Question 96
Not answered
Marked out of 1.00
Flag question
Question text
A characteristic of RAM (random access memory) is that it is persistent and is not lost when the power to a computer is turned off.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 97
Not answered
Marked out of 1.00
Flag question
Question text
A full binary tree has a restricted shape which starts at the root and fills the tree by levels from left to right.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 98
Not answered
Marked out of 1.00
Flag question
Question text
What is the role of the pivot in a quicksort algorithm?
Select one:
a. It identifies the maxkey value
b. It specifies the point where the array will be subdivided into partitions and each partition then sorted
c. It defines the sequence for merging in the sort
d. It indicates the index of the current record being compared
Feedback
The correct answer is: It specifies the point where the array will be subdivided into partitions and each partition then sorted
Question 99
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
/** @return The position of an element in sorted array A with value k. If k is not in A,return A.length. */
static int binary(int[] A, int k) {
int l = -1; // Set l and r
int r = A.length; // beyond array bounds
while (l+1 != r) { // Stop when l, r meet
int i = (l+r)/2; // Check middle
if (k < A[i]) r = i; // In left half
if (k == A[i]) return i; // Found it
if (k > A[i]) l = i; // In right half
}
return A.length; // Search value not in A
}
Choice 1. Θ ( n )
Choice 2. O( 2n )
Choice 3. O( log n )
Choice 4. Ω( n2 )
(NOTE: code fragment is not intended to be functioning code)

Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 3
Question 100
Not answered
Marked out of 1.00
Flag question
Question text
A linear index is an index file organized as a sequence of key/pointer pairs where the keys are in a sorter order.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 101
Not answered
Marked out of 1.00
Flag question
Question text
The freelist …
Select one:
a. Provides access to memory within the operating system that has not yet been allocated
b. Provides access to memory objects which have no Big O ( n ) time.
c. Facilitates and encourages the use of the new operator.
d. Holds the list nodes that are no longer in use.
Feedback
The correct answer is: Holds the list nodes that are no longer in use.
Question 102
Not answered
Marked out of 1.00
Flag question
Question text
A tree data structure whose shape obeys the following definition,
o A node contains one or two keys
o Every internal node has either 2 children if it contains 1 key or 3 children if it contains two keys
o All leaves are at the same level in the tree
Is called a/an:
Select one:
a. B*-Tree
b. BST
c. B+-Tree
d. 2-3 tree
Feedback
The correct answer is: 2-3 tree
Question 103
Not answered
Marked out of 1.00
Flag question
Question text
A preorder traversal visits every node starting at the leaf nodes and working up the tree.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 104
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
public E getValue ( ) {
assert (curr >= 0) && (curr < listSize) :
"No current element";
return listArray[curr];
}
Choice 1. Θ ( n )
Choice 2. O( 2n )
Choice 3. Θ( n log n )
Choice 4. O( 1 )
(NOTE: code fragment is not intended to be functioning code)


Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 4
Question 105
Not answered
Marked out of 1.00
Flag question
Question text
Internal Fragmentation refers to: (select the best answer)
Select one:
a. Space that is left empty because records do not fit evenly into a sector
b. Space allocated to a file that is not physically adjacent on the disk drive
c. Space that is left empty because records do not fit evenly into a sector or Space allocated to a file that is not physically adjacent
d. None of the options
Feedback
The correct answer is: Space that is left empty because records do not fit evenly into a sector or Space allocated to a file that is not physically adjacent
Question 106
Not answered
Marked out of 1.00
Flag question
Question text
A binary tree traversal that lists every node in the tree exactly once is called:
Select one:
a. a Traversal
b. A visitor design pattern
c. An enumeration
d. Natural ordering sequence
Feedback
The correct answer is: An enumeration
The process of associating a key with the location of a corresponding data record is called folding.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 2
Not answered
Marked out of 1.00
Flag question
Question text
A characteristic of RAM (random access memory) is that it is persistent and is not lost when the power to a computer is turned off.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 3
Not answered
Marked out of 1.00
Flag question
Question text
An algorithm that breaks a file to be sorted in smaller files called runs which are sorted and eventually put back together resulting in a sorted file is called:
Select one:
a. Quicksort algorithm
b. Replacement sort algorithm
c. An indexed key sort algorithm
d. Mergesort algorithm
Feedback
The correct answer is: Mergesort algorithm
Question 4
Not answered
Marked out of 1.00
Flag question
Question text
The weighted union rule joins a tree with fewer nodes to a tree with more nodes by making the smaller tree’s root point to the root of the larger tree.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 5
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the option that represents the most appropriate asymptotic analysis:
for (int i = 1; i <= n; i *= 2) {
for (int j = 0; j < n; j++) {
count++;
}
}
Option 1. O( 1 )
Option 2. O( 2n )
Option 3. O( n log n )
Option 4. O( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
Explanation: Here the outer loop is done log n times and the inner loop is done n times, so T(n) = n log n. (Note that the default base for logarithms in Computer Science is 2.)
The correct answer is: Option 3
Question 6
Not answered
Marked out of 1.00
Flag question
Question text
The best asymptotic analysis for the selection sort is represented by (select the best option):
Option 1. O( n log n )
Option 2. Ω( n2 )
Option 3. O( n2 )
Option 4. Θ( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
The correct answer is: Option 4
Question 7
Not answered
Marked out of 1.00
Flag question
Question text
A leaf is any node that:
Select one:
a. Has one child
b. Is an internal node with no ancestors
c. Is any node with two empty children
d. Is the ancestor of the root node
Feedback
The correct answer is: Is any node with two empty children
Question 8
Not answered
Marked out of 1.00
Flag question
Question text
A preorder traversal visits every node starting at the leaf nodes and working up the tree.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 9
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the option which represents the most appropriate asymptotic analysis:
/** @return Position of largest value in "A“ */
static int largest(int[] A) {
int currlarge = 0; // Position of largest
for (int i=1; i<A.length; i++)
if (A[currlarge] < A[i])
currlarge = i; // Remember pos
return currlarge; // Return largest pos
}

Choice 1. Θ ( n )
Choice 2. O( 2n )
Choice 3. Θ( n log n )
Choice 4. Ω( n2 )
(NOTE: code fragment is not intended to be functioning code)

Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 1
Question 10
Not answered
Marked out of 1.00
Flag question
Question text
A technique that allows a programmer to use more main memory than exists in the computer is called: (select the best answer)
Select one:
a. Buffer cache
b. Random access memory
c. Secondary storage
d. Virtual memory
Feedback
The correct answer is: Virtual memory
Question 11
Not answered
Marked out of 1.00
Flag question
Question text
A method that is designed to create extremely shallow trees is called:
Select one:
a. Dynamic node implementation
b. Union/Find
c. The list of children method
d. Path compression
Feedback
The correct answer is: Path compression
Question 12
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
static int function ( n ) {
sum = 0;
for (j=1; j<=n; j++)
for (i=1; i<=j; i++)
sum++;
return sum;
}
Choice 1. Θ ( n )
Choice 2. O( 2n )
Choice 3. Θ( n2 )
Choice 4. Ω( n2 )
(NOTE: code fragment is not intended to be functioning code)


Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 3
Question 13
Not answered
Marked out of 1.00
Flag question
Question text
Asymptotic Algorithm Analysis is primarily concerned with:
Select one:
a. The size of the constant in the algorithm running time equation
b. The speed of the computing running the algorithm
c. The speed of the compiler
d. The growth rate demonstrated in the algorithm running time equation
Feedback
The correct answer is: The growth rate demonstrated in the algorithm running time equation
Question 14
Not answered
Marked out of 1.00
Flag question
Question text
According to the properties of logarithms, log(nm) =
Note: Due to issues with HTML formatting, an exponent is represented by preceding it with the ^ symbol. As such x^2 is equivalent to x2.
Select one:
a. log n – log m
b. n log n
c. log n + log m
d. log(n^m)
Feedback
The correct answer is: log n + log m
Question 15
Not answered
Marked out of 1.00
Flag question
Question text
The process for visiting all of the nodes of a binary tree in some order is called a traversal.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 16
Not answered
Marked out of 1.00
Flag question
Question text
A list is said to be empty when all of its elements have a zero (0) value
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 17
Not answered
Marked out of 1.00
Flag question
Question text
A list that organizes the order of records within the list based upon patterns of actual record access is called a/an (select the best answer):
Select one:
a. Quadratic Binary search order
b. A Zipf Distribution
c. A Self-organizing list
d. A range query
Feedback
The correct answer is: A Self-organizing list
Question 18
Not answered
Marked out of 1.00
Flag question
Question text
A sort that features a limit of n-1 of record swaps is called:
Select one:
a. Insertion sort
b. Bubble sort
c. Inversion sort
d. Selection sort
Feedback
The correct answer is: Selection sort
Question 19
Not answered
Marked out of 1.00
Flag question
Question text
The process of storing blocks of data in main memory after reading from disk is referred to as:
Select one:
a. Buffering
b. Hashing
c. Pooling
d. Indexing
Feedback
The correct answer is: Buffering
Question 20
Not answered
Marked out of 1.00
Flag question
Question text
The upper bound for the growth of the Algorithms running time is represented by:
Select one:
a. Big Oh (O)
b. Big Omega (Ω)
c. Big Theta (Θ)
d. Exponential growth
Feedback
The correct answer is: Big Oh (O)
Question 21
Not answered
Marked out of 1.00
Flag question
Question text
A coding scheme that replaces repeated occurrences of strings with a pointer to the location in the file of the first occurrence of the string is called Ziv-Lempel coding.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 22
Not answered
Marked out of 1.00
Flag question
Question text
In linked lists there are no NULL links in:
Select one:
a. Single linked list
b. Linear doubly linked list
c. Circular linked list
d. None of these
Feedback
The correct answer is: Circular linked list
Question 23
Not answered
Marked out of 1.00
Flag question
Question text
The benefit of a quicksort is that it provides excellent performance in both the average and worst case:
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 24
Not answered
Marked out of 1.00
Flag question
Question text
Internal Fragmentation refers to: (select the best answer)
Select one:
a. Space that is left empty because records do not fit evenly into a sector
b. Space allocated to a file that is not physically adjacent on the disk drive
c. Space that is left empty because records do not fit evenly into a sector or Space allocated to a file that is not physically adjacent
d. None of the options
Feedback
The correct answer is: Space that is left empty because records do not fit evenly into a sector or Space allocated to a file that is not physically adjacent
Question 25
Not answered
Marked out of 1.00
Flag question
Question text
A binary tree traversal that lists every node in the tree exactly once is called:
Select one:
a. a Traversal
b. A visitor design pattern
c. An enumeration
d. Natural ordering sequence
Feedback
The correct answer is: An enumeration
Question 26
Not answered
Marked out of 1.00
Flag question
Question text
Which of the following is not one of the general approaches to search algorithms:
Select one:
a. Buffer cache access methods
b. Sequential and list methods
c. Direct access by key value (hashing)
d. Tree indexing methods
Feedback
The correct answer is: Buffer cache access methods
Question 27
Not answered
Marked out of 1.00
Flag question
Question text
In a queue, placing new items in the queue is referred to as a push and taking an item out of the queue is called a pop.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 28
Not answered
Marked out of 1.00
Flag question
Question text
Which of the following is not a mathematical proof technique?
Select one:
a. Proof by mathematical induction
b. Proof by contradiction
c. Direct proof
d. Proof by consensus
Feedback
The correct answer is: Proof by consensus
Question 29
Not answered
Marked out of 1.00
Flag question
Question text
True/False: There is always one most efficient algorithm to solve a particular problem.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 30
Not answered
Marked out of 1.00
Flag question
Question text
The process of determining if two objects are in the same set and then merging those sets is called:
Select one:
a. a Union Operation
b. Union / Find
c. a Weighted Union
d. a Merge Operation
Feedback
The correct answer is: Union / Find
Question 31
Not answered
Marked out of 1.00
Flag question
Question text
Data is stored within the disk drive on the: (select the best answer)
Select one:
a. Spindle
b. Platter
c. Cylinder
d. Sector
Feedback
The correct answer is: Platter
Question 32
Not answered
Marked out of 1.00
Flag question
Question text
The depth of node H in the following tree is:

Select one:
a. 3
b. 2
c. 4
d. 1
Feedback
The correct answer is: 3
Question 33
Not answered
Marked out of 1.00
Flag question
Question text
An ADT is:
Select one:
a. A type together with a collection of operations to manipulate the type
b. An implementation of a flyweight design pattern
c. The realization of a data type as a software component
d. An implementation in java of a class for a data type
Feedback
The correct answer is: The realization of a data type as a software component
Question 34
Not answered
Marked out of 1.00
Flag question
Question text
A full binary tree has a restricted shape which starts at the root and fills the tree by levels from left to right.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 35
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
function ( n ) {
sum1 = 0;
for (k=1; k<=n; k*=2)
for (j=1; j<=n; j++)
sum1++;
}
Choice 1. Θ ( n )
Choice 2. O( 2n )
Choice 3. Θ( n log n )
Choice 4. Ω( n2 )
(NOTE: code fragment is not intended to be functioning code)

Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 3
Question 36
Not answered
Marked out of 1.00
Flag question
Question text
A linked list creates order through the use of pointers that link one element to another.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 37
Not answered
Marked out of 1.00
Flag question
Question text
The implementation of a data type as a data structure is the physical form of an ADT.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 38
Not answered
Marked out of 1.00
Flag question
Question text
Secondary storage is characterized by the following:
Select one:
a. It is persistent
b. It is faster than primary storage
c. It is volatile
d. It is more expensive than primary storage
Feedback
The correct answer is: It is persistent
Question 39
Not answered
Marked out of 1.00
Flag question
Question text
The process of storing records in the order that they were added to a file is called:
Select one:
a. Entry-sequenced file
b. Binary Sequenced file
c. LIFO file format
d. Tombstone approach
Feedback
The correct answer is: Entry-sequenced file
Question 40
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select option that represents the most appropriate asymptotic analysis:
for (i=0; i<n; i++) {
//
// Search in array a for smallest element starting at i to n-1
//
minIndex = findSmallestElement(a, i, n-1)
a[i] = a[minIndex];
}
findSmallestElement( int a[], int i, int n ) {
int largest = a[i];
while(i<n) {
if(a[i] >a[largest])
largest = i;
i++;
}
return(largest);
}
Option 1. O( n )
Option 2. O( 2n )
Option 3. O( n log n )
Option 4. O( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
index-of-smallest element in a[i..j] takes j-i+1 operations
• n + (n-1) + (n-2) + (n-3) + ... + 3 + 2 + 1
• this is n2
The correct answer is: Option 4
Question 41
Not answered
Marked out of 1.00
Flag question
Question text
When big-Oh and  coincide, we indicate this by using (select the best answer):
1. Big Oh (O)
2. Big Omega (Ω)
3. Big Theta (Θ)
4. Exponential growth
Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 3
Question 42
Not answered
Marked out of 1.00
Flag question
Question text
Which of the following is not a characteristic of an algorithm?
Select one:
a. It must be correct
b. It must be composed of concrete steps
c. It can have no ambiguity
d. It must be composed of an infinite number of steps.
Feedback
The correct answer is: It must be composed of an infinite number of steps.
Question 43
Not answered
Marked out of 1.00
Flag question
Question text
Each record of a database normally has a unique identifier called the:
Select one:
a. Secondary Key
b. Primary index
c. Primary key
d. Index key
Feedback
The correct answer is: Primary key
Question 44
Not answered
Marked out of 1.00
Flag question
Question text
Which of the following is NOT one of the buffer pool heuristics defined in the text : (select the best answer)
Select one:
a. FIFO
b. LIFO
c. LRU
d. LFU
Feedback
The correct answer is: LIFO
Question 45
Not answered
Marked out of 1.00
Flag question
Question text
A collection of one or more trees is called:
Select one:
a. Trees
b. Multiple Spanning Trees
c. a Forest
d. Traversals
Feedback
The correct answer is: a Forest
Question 46
Not answered
Marked out of 1.00
Flag question
Question text
Enqueue and Dequeue are notations associated with which data structure:
Select one:
a. Queue
b. Stack
c. List
d. Array
Feedback
The correct answer is: Queue
Question 47
Not answered
Marked out of 1.00
Flag question
Question text
A traversal that visits each node after visiting its children is called:
Select one:
a. Preorder Traversal
b. Postorder Traversal
c. Inorder Traversal
d. Outoforder Traversal
Feedback
The correct answer is: Postorder Traversal
Question 48
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
function ( n ) {
sum2 = 0;
for (k=1; k<=n; k*=2)
for (j=1; j<=k; j++)
sum2++;
}
Choice 1. O( 2n )
Choice 2. Θ ( n )
Choice 3. Θ( n log n )
Choice 4. Ω( n2 )
(NOTE: code fragment is not intended to be functioning code)

Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 2
Question 49
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the option that represents the most appropriate asymptotic analysis:
public static int binarySearch(int[] a, int key) {
int left = 0;
int right = a.length-1;
while (left <= right) {
int mid = left + (right-left)/2;
if (key < a[mid]) right = mid-1;
else if (key > a[mid]) left = mid+1;
else return mid;
}
//not found
return -1;
}
Option 1. Ω( 1 ), O( log n )
Option 2. Ω( n ), O( 2n )
Option 3. Θ( n log n )
Option 4. Θ( log n )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
The correct answer is: Option 1
Question 50
Not answered
Marked out of 1.00
Flag question
Question text
The processing time or cost of a sort is defined by the number of comparisons and exchanges that must be made during processing. What is the average cost of the heapsort?:
Option 1. O( n log n )
Option 2. Ω( n2 )
Option 3. O( n2 )
Option 4. Θ( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
The correct answer is: Option 1
Question 51
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
public E getValue ( ) {
assert (curr >= 0) && (curr < listSize) :
"No current element";
return listArray[curr];
}
Choice 1. Θ ( n )
Choice 2. O( 2n )
Choice 3. Θ( n log n )
Choice 4. O( 1 )
(NOTE: code fragment is not intended to be functioning code)


Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 4
Question 52
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the option that represents the most appropriate asymptotic analysis:
// Recursive Fibonacci generator
static long fibr(int n) {
if ((n == 1) || (n == 2)) return 1; // Base case
return fibr(n-1) + fibr(n-2); // Recursive call
}
Option 1. O( n )
Option 2. O( 2n )
Option 3. O( n log n )
Option 4. O( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
The correct answer is: Option 2
Question 53
Not answered
Marked out of 1.00
Flag question
Question text
True/False: Big Theta (Θ) indicates that the Upper and Lower bounds of an algorithm are the same.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 54
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
static int function ( n ) {
for (k=0; k<n; k++)
A[k] = k;
return A[k];
}
Choice 1. O ( n2 )
Choice 2. O( 2n )
Choice 3. Ω( n2 )
Choice 4. Θ ( n )
(NOTE: code fragment is not intended to be functioning code)

Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 4
Question 55
Not answered
Marked out of 1.00
Flag question
Question text
The freelist …
Select one:
a. Provides access to memory within the operating system that has not yet been allocated
b. Provides access to memory objects which have no Big O ( n ) time.
c. Facilitates and encourages the use of the new operator.
d. Holds the list nodes that are no longer in use.
Feedback
The correct answer is: Holds the list nodes that are no longer in use.
Question 56
Not answered
Marked out of 1.00
Flag question
Question text
Which of the following is NOT true for Linked Lists structures (please select the best choice):
Choice 1. Insertion and deletion are ( 1 ).
Choice 2. Direct access of an item in the list structure is ( n ).
Choice 3. Space grows with number of elements.
Choice 4. There is no overhead associated with elements in the list structure
Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 4
Question 57
Not answered
Marked out of 1.00
Flag question
Question text
A sort algorithm that uses two nested loops with the inner loop moving through the array from bottom to top is called the:
Select one:
a. Insertion sort
b. Bubble sort
c. Inversion sort
d. Selection sort
Feedback
The correct answer is: Bubble sort
Question 58
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the option which represents the most appropriate asymptotic analysis:
static int function ( n ) {
sum = 0;
for (i=1; i<=n; i++)
sum += n;
return sum;
}
Option 1. Ω( n2 )
Option 2. Θ ( n )
Option 3. O( log n )
Option 4. O( 2n )
(NOTE: code fragment is not intended to be functioning code)


Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 2
Question 59
Not answered
Marked out of 1.00
Flag question
Question text
A list is
Select one:
a. An ADT for storing and retrieving data
b. A tree data structure
c. Finite ordered sequence of data items
d. A collection of operations to implement an ADT
Feedback
The correct answer is: Finite ordered sequence of data items
Question 60
Not answered
Marked out of 1.00
Flag question
Question text
Push and Pop are notations associated with which data structure:
Select one:
a. Queue
b. Stack
c. List
d. Array
Feedback
The correct answer is: Stack
Question 61
Not answered
Marked out of 1.00
Flag question
Question text
A tree whose internal nodes all have exactly K children is called a K-ary tree.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 62
Not answered
Marked out of 1.00
Flag question
Question text
A compound computed search that combines a binary search to get close to the required record and then uses sequential search to find the item is referred to as a/an:
Select one:
a. Zipf search
b. An Exact match search
c. A Dictionary search
d. bit map vector search
Feedback
The correct answer is: A Dictionary search
Question 63
Not answered
Marked out of 1.00
Flag question
Question text
Correctly identify the following heap structure by selecting the best answer:

Select one:
a. partially ordered heap
b. max-heap structure
c. priority heap
d. min-heap structure
Feedback
The correct answer is: max-heap structure
Question 64
Not answered
Marked out of 1.00
Flag question
Question text
A traversal that visits each node before visiting its children is called:
Select one:
a. Preorder traversal
b. Postorder traversal
c. Inorder Traversal
d. Outoforder Traversal
Feedback
The correct answer is: Preorder traversal
Question 65
Not answered
Marked out of 1.00
Flag question
Question text
A tree data structure whose shape obeys the following definition,
o A node contains one or two keys
o Every internal node has either 2 children if it contains 1 key or 3 children if it contains two keys
o All leaves are at the same level in the tree
Is called a/an:
Select one:
a. B*-Tree
b. BST
c. B+-Tree
d. 2-3 tree
Feedback
The correct answer is: 2-3 tree
Question 66
Not answered
Marked out of 1.00
Flag question
Question text
Select the answer that best defines Huffman Coding:
Select one:
a. A set of coding rules that is typically used for compression
b. A fixed length coding scheme for character representation
c. A tree structure that trades off space and time requirements to provide a more efficient priority queue
d. An approach of assigning codes to characters such that the frequency length of the code depends upon the relative frequency of the corresponding character in use
Feedback
The correct answer is: An approach of assigning codes to characters such that the frequency length of the code depends upon the relative frequency of the corresponding character in use
Question 67
Not answered
Marked out of 1.00
Flag question
Question text
A significant benefit to using an index to hold and sort keys to a file is:
Select one:
a. Smaller keys require less I/O
b. The entire sort can always be completed in memory
c. The head of the disk drive does not need to move
d. There is no seek time added to the latency of I/O operations
Feedback
The correct answer is: Smaller keys require less I/O
Question 68
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
static int function ( n ) {
sum = 0;
for (i=1; i<=n; i++)
sum += n;
return sum;
}
Choice 1. Ω( n2 )
Choice 2. Θ ( n2 )
Choice 3. O( log n )
Choice 4. O( n )
(NOTE: code fragment is not intended to be functioning code)


Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 4
Question 69
Not answered
Marked out of 1.00
Flag question
Question text
The most time consuming of the following operations on an array based list implementation is:
Select one:
a. Inserting a new element at position n-1 in the list where n is the number of elements in the list.
b. Inserting a new element into the head of the list.
c. Removing an element at position n-1 within the list
d. Removing an element from the tail of the list.
Feedback
The correct answer is: Inserting a new element into the head of the list.
Question 70
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
static int function ( n ) {
sum = 0;
for (i=1; i<=n; i++)
sum += n;
return sum;
}
Choice 1. Ω( n2 )
Choice 2. Ω( log n2 )
Choice 3. Θ( n log n )
Choice 4. O ( n )
(NOTE: code fragment is not intended to be functioning code)



Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 4
Question 71
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
function ( n ) {
sum1 = 0;
for (i=1; i<=n; i++)
for (j=1; j<=n; j++)
sum1++;
}
Choice 1. Θ ( n2 )
Choice 2. O( 2n )
Choice 3. Θ( n log n )
Choice 4. Ω( log n2 )
(NOTE: code fragment is not intended to be functioning code)

Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 1
Question 72
Not answered
Marked out of 1.00
Flag question
Question text
A linked list implementation relies upon static memory allocation where static refers to the requirement to pre-allocate all of the memory that will be used for the list.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 73
Not answered
Marked out of 1.00
Flag question
Question text
A sorting algorithm that assigns records to bins and then relies on some other sorting technique to sort the records within each bin called:
Select one:
a. Radix Sort
b. Quicksort
c. Hash sort
d. Bucket sort
Feedback
The correct answer is: Bucket sort
Question 74
Not answered
Marked out of 1.00
Flag question
Question text
True/False: The stack data structure is implemented as a LIFO structure (last in first out)
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 75
Not answered
Marked out of 1.00
Flag question
Question text
True/False: The queue data structure is implemented as FIFO structure (first in first out)
:
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 76
Not answered
Marked out of 1.00
Flag question
Question text
Recursion is when an algorithm uses a series of loop structures to repeat an operation until the answer has been computed.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 77
Not answered
Marked out of 1.00
Flag question
Question text
Which of the following is NOT one of the design patterns outlined in our text.
Select one:
a. Flyweight
b. Visitor
c. Composite
d. Synergy
Feedback
The correct answer is: Synergy
Question 78
Not answered
Marked out of 1.00
Flag question
Question text
In a stack which option would access the 3rd element from the top of the stack S
Option 1. S.push(-1);
Option 2. S.dequeue(-3);
Option 3. S.pop();
S.pop();
S.pop();
Option 4. S.pop(n-3);
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
The correct answer is: Option 3
Question 79
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
/** @return The position of an element in sorted array A with value k. If k is not in A,return A.length. */
static int binary(int[] A, int k) {
int l = -1; // Set l and r
int r = A.length; // beyond array bounds
while (l+1 != r) { // Stop when l, r meet
int i = (l+r)/2; // Check middle
if (k < A[i]) r = i; // In left half
if (k == A[i]) return i; // Found it
if (k > A[i]) l = i; // In right half
}
return A.length; // Search value not in A
}
Choice 1. Θ ( n )
Choice 2. O( 2n )
Choice 3. O( log n )
Choice 4. Ω( n2 )
(NOTE: code fragment is not intended to be functioning code)

Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 3
Question 80
Not answered
Marked out of 1.00
Flag question
Question text
A traversal that visits the left subtree, then the node, and then the right subtree is called:

Select one:
a. Preorder Traversal
b. Postorder Traversal
c. Inorder Traversal
d. Outoforder Traversal
Feedback
The correct answer is: Inorder Traversal
Question 81
Not answered
Marked out of 1.00
Flag question
Question text
Inserting or removing an item at position n-1 within a linked list has the same cost in terms  ( n ) time as the same operation in an array based implementation of a list.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 82
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the option that represents the most appropriate asymptotic analysis:
if (a.length > 0) {
return a[a.length - 1];
} else {
throw new NoSuchElementException();
}
Option 1. O( 1 )
Option 2. O( 2n )
Option 3. O( n log n )
Option 4. O( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
Explanation: Here n = a.length, and T(n) = 1.
The correct answer is: Option 1
Question 83
Not answered
Marked out of 1.00
Flag question
Question text
The most significant difference between the B+-Tree and the BST is that the B+-Tree stores records only at the leaf nodes.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 84
Not answered
Marked out of 1.00
Flag question
Question text
According to textbook by Shaffer, a heap data structure has two properties which are:
Select one:
a. every node stores a value less than or equal to that of its children and it is a complete binary tree
b. it is a min-heap and is partially ordered
c. it is a complete binary tree and the values stored in it are partially ordered
d. it is a priority queue and is in Θ( n )
Feedback
The correct answer is: it is a complete binary tree and the values stored in it are partially ordered
Question 85
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
static int function ( n ) {
for (k=0; k<n; k++)
A[k] = k;
return A[k];
}
Choice 1. Θ ( n log n )
Choice 2. O( 2n )
Choice 3. O( n )
Choice 4. Ω( n2 )
(NOTE: code fragment is not intended to be functioning code)



Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 3
Question 86
Not answered
Marked out of 1.00
Flag question
Question text
A linear index is an index file organized as a sequence of key/pointer pairs where the keys are in a sorter order.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 87
Not answered
Marked out of 1.00
Flag question
Question text
An exchange sort is one where: (select the best answer)
Select one:
a. Records in an unsorted list are moved to a sorted list
b. Adjacent records in the list and compared and exchanged
c. An inversion is executed
d. The sorting algorithm is said to be stable
Feedback
The correct answer is: Adjacent records in the list and compared and exchanged
Question 88
Not answered
Marked out of 1.00
Flag question
Question text
What is the role of the pivot in a quicksort algorithm?
Select one:
a. It identifies the maxkey value
b. It specifies the point where the array will be subdivided into partitions and each partition then sorted
c. It defines the sequence for merging in the sort
d. It indicates the index of the current record being compared
Feedback
The correct answer is: It specifies the point where the array will be subdivided into partitions and each partition then sorted
Question 89
Not answered
Marked out of 1.00
Flag question
Question text
If A={1, 2, 3, 4} and B={4, 5, 6}, find A∪ B .
Select one:
a. {1,2,3,4,4,5,6}
b. {4}
c. {x | x is all positive integers}
d. {1,2,3,4,5,6}
Feedback
The correct answer is: {1,2,3,4,5,6}
Question 90
Not answered
Marked out of 1.00
Flag question
Question text
Setting the dirty bit causes what action to be performed on a block: (select the best answer)
Select one:
a. It is deleted because it is no longer consistent
b. It flushes or writes the block out to the disk
c. Refreshes the data by re-reading the block
d. It cleans the cache by flushing all data from the cache
Feedback
The correct answer is: It flushes or writes the block out to the disk
Question 91
Not answered
Marked out of 1.00
Flag question
Question text
Which of the following items is NOT true for Array-Based Lists (please select the best choice):
Choice 1. Insertion and deletion operations are ( n )
Choice 2. Direct access of an item in the array is ( 1 )
Choice 3. Space used grows dynamically as the array is populated
Choice 4. Array contains wasted space if array positions are not full
Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 3
Question 92
Not answered
Marked out of 1.00
Flag question
Question text
The lower bound for the growth of the Algorithms running time is represented by (please the best answer):
1. Big Oh (O)
2. Big Omega (Ω)
3. Big Theta (Θ)
4. Exponential growth
Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 2
Question 93
Not answered
Marked out of 1.00
Flag question
Question text
A sequential tree can be represented using a bit vector?
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 94
Not answered
Marked out of 1.00
Flag question
Question text
The list of children approach uses both pointers and an array structure to represent the tree.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 95
Not answered
Marked out of 1.00
Flag question
Question text
The upper bound for the growth of the Algorithms running time is represented by (please select the best answer):
1. Big Oh (O)
2. Big Omega (Ω)
3. Big Theta (Θ)
4. Exponential growth
Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 1
Question 96
Not answered
Marked out of 1.00
Flag question
Question text
A traversal of a general tree that traverses the roots subtrees from left to right, then visits the root is called a preorder traversal.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 97
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the most appropriate asymptotic analysis:
// Towers of Hanoi
static void solveHanoi(int disks, char fromPole, char toPole, char withPole) {
if (disks >= 1) {
solveHanoi(disks-1, fromPole, withPole, toPole);
moveDisk(fromPole, toPole);
solveHanoi(disks-1, withPole, toPole, fromPole);
}
}
static void moveDisk(char fromPole, char toPole) {
moves++;
}
Option 1. O( n )
Option 2. O( 2n )
Option 3. O( n log n )
Option 4. O( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
The correct answer is: Option 2
Question 98
Not answered
Marked out of 1.00
Flag question
Question text
The full binary tree theorem states “the number of leaves in an empty full binary tree is one more than the number of internal nodes”
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 99
Not answered
Marked out of 1.00
Flag question
Question text
The quicksort is typically slower than the heapsort by a constant factor.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question 100
Not answered
Marked out of 1.00
Flag question
Question text
A sort where the list is divided into halves, the halves sorted and these two halves are merged is called:
Select one:
a. Mergesort
b. Binary sort
c. Quicksort
d. Heapsort
Feedback
The correct answer is: Mergesort
Question 101
Not answered
Marked out of 1.00
Flag question
Question text
An important advantage of the sequential tree implementation is that (select the best answer):
Select one:
a. It is an extremely shallow tree
b. The data structure can be transmitted between computers
c. It saves space because no pointers are stored
d. It uses dynamic nodes
Feedback
The correct answer is: It saves space because no pointers are stored
Question 102
Not answered
Marked out of 1.00
Flag question
Question text
True/False: Big Theta (Θ) indicates that the Upper and Lower bounds of an algorithm are the same.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 103
Not answered
Marked out of 1.00
Flag question
Question text
A solution is said to be efficient if it:
Select one:
a. Solves the problem within the required resource constraints
b. Executes faster than other solutions
c. Is completed in the fewest number of steps
d. Can be explained in the context of Big-Oh notation
Feedback
The correct answer is: Solves the problem within the required resource constraints
Question 104
Not answered
Marked out of 1.00
Flag question
Question text
A finite set of one or more nodes such that there is one designated node call the root is a: (select the best answer)
Select one:
a. Parent root
b. a B+ tree data structure
c. Index
d. Tree
Feedback
The correct answer is: Tree
Question 105
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the option that represents the most appropriate asymptotic analysis:
for (int i = 0; i < a.length; i++) {
System.out.println(a[i]);
}
Option 1. O( n )
Option 2. O( 2n )
Option 3. O( n log n )
Option 4. O( n2 )
Select one:
a. Option 1
b. Option 2
c. Option 3
d. Option 4
Feedback
The correct answer is: Option 1
Question 106
Not answered
Marked out of 1.00
Flag question
Question text
For the following code fragment, select the choice which represents the most appropriate asymptotic analysis:
function ( n ) {
sum2 = 0;
for (i=1; i<=n; i++)
for (j=1; j<=i; j++)
sum2++;
}
}
Choice 1. Ω ( 1 )
Choice 2. O( 2n )
Choice 3. Θ( n2 )
Choice 4. Ω( n2 )
(NOTE: code fragment is not intended to be functioning code)

Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
Feedback
The correct answer is: Choice 3

 

CallTutors Guarantees

  • Work Within Deadline
  • Lowest Price Guranteed
  • Plagiarism Free Guranteed
  • 24 * 7 Availability
  • Native Experienced Experts
  • Free Revisions

Reviews

Total Reviews: 81

Research essay writing02/18/2018

Hi, i have given them my research essay writing work and these guys are just awesome. They have some of the best UK writers. Just love them for their quality service and delivery.

Tani J.
so much perfection02/17/2018

They handle each order with so much perfection. I got the assignment well before the time and it was written nicely. I never knew they could be of such a great help, and after seeing the quality of their work I’ve decided to hire them only for future projects.

Charlie Cassandra
Management Assignment02/16/2018

The subject assigned to me was not clear and as I couldn’t take risk my marks, I made a decision to hire Management Assignment Help service. I got my assignment in time and it was written perfectly. All the important things and points were properly covered and wonderfully written.

Russell Ash
Accounting Assignment Help02/12/2018

I was searching Accounting Assignment Help. I got professionals help and their services are really very good. Thanks

Nadeem Aslam
Great Support Team02/09/2018

Great experience, great service!!

George

Read More...