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
|
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)