1) Given the following list: 90 8 7 56 123 235 9 1 653 Can you guess the name of the sorting algorithm? 8 90 7 56 123 235 9 1 653 7 8 90 56 123 235 9 1 653 7 8 56 90 123 235 9 1 653 7 8 9 56 90 123 235 1 653 1 7 8 9 56 90 123 235 653
Given the following list:
90 8 7 56 123 235 9 1 653
Can you guess the name of the sorting
8 90 7 56 123 235 9 1 653
7 8 90 56 123 235 9 1 653
7 8 56 90 123 235 9 1 653
7 8 9 56 90 123 235 1 653
1 7 8 9 56 90 123 235 653
Merge Sort
|
|
Insertion Sort
|
|
Selection Sort
|
|
Quick Sort
|
What is the recursive part in recursive factorial function?
if (n=0) return 1;
|
|
if (n==0) return 0;
|
|
if (n>0) return n*factorial(n-1);
|
|
if (n==0) return 1;
|
Which one of the following is not true about Linked Structures?
Series of objects make up a linked list
|
|
Object reference variables hold the address of an object
|
|
Linked Structures uses a one big contiguous block of memory
|
|
Linked structure uses object references to create links between objects
|
For the following minheap, which is implemented with arrays
[3][4][7]
What would be the content of the array after the insertion of the next element 2?
ps: Do not forget to swap the elements, and keep minheap properties
[3][4][7][2]
|
|
[2][3][7][4]
|
|
[3][2][7][4]
|
|
[2][3][4][7]
|
Asymptotic complexities of some of the algorithms are given below. Please select the fastest one.
|
|
O(logN)
|
|
O(N)
|
|
|
sum(1…N) = N + sum(1…(N-2))
|
|
sum(1…N) = N + sum(1…(N-1))
|
|
sum(1…N) = N + sum(1…(N))
|
|
sum(1…N) = N + sum(0…(N-1))
|
Consider the following code and choose the right algorithm used in the following code.
public static <T extends Comparable<T>>
void sortMe(T[] data){
int position, scan;
T temp;
for (position = data.length - 1; position >= 0; position--)
{
for (scan = 0; scan <= position - 1; scan++)
{
if (data[scan].compareTo(data[scan+1]) > 0)
swap(data, scan, scan + 1);
}
}
}
Selection Sort
|
|
Insertion Sort
|
|
Quick Sort
|
|
Bubblee Sort
|
If a binary search tree is not __________, it may be less efficient than a linear structure.
complete
|
|
empty
|
|
balanced
|
|
None of the above
|
Which one of the following is not true for abstraction?
Runs your code every time more efficient
|
|
Makes concept easier to manage
|
|
Encapsulates the object's data and the implementation of the operations
|
|
All objects are abstractions in that they provide well-defined operations
|
A B-tree with the order of 4 is a ________ tree.
heap
|
|
high-order
|
|
2-3
|
|
2-4
|
Trending now
This is a popular solution!
Step by step
Solved in 2 steps