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

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
 
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

 
Question 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   6537    8   56   90  123   235   9   1   6537    8   9    56   90  123   235   1   6531    7    8   9    56   90  123   235   653
 
Merge Sort
 
Insertion Sort
 
Selection Sort
 
Quick Sort
 
 
2)

What is the recursive part in recursive factorial function?

 
Question 2 - 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;
 
 
3)

Which one of the following is not true about Linked Structures?

 
Question 3 - 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
 
 
4)

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

 
Question 4 - 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]
 
 
5)

Asymptotic complexities of some of the algorithms are given below. Please select the fastest one.

 
Question 5 - Asymptotic complexities of some of the algorithms are given below. Please select the fastest one.
 

 

 
O(logN)
 
O(N)
 

 

 
 
6)
Consider the problem of computing the sum of all the integers between 1 and N, inclusive If N is 5, the sum is
 
Question 6 - Consider the problem of computing the sum of all the integers between 1 and N, inclusive If N is 5, the sum is  
 
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))
 
 
7)

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);

                     }

            }

   }

 

 
Question 7 - 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
 
 
8)

If a binary search tree is not __________, it may be less efficient than a linear structure.

 
Question 8 - If a binary search tree is not __________, it may be less efficient than a linear structure.
 
complete
 
empty
 
balanced
 
None of the above
 
 
9)

Which one of the following is not true for abstraction?

 
Question 9 - 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
 
 
10)

A B-tree with the order of 4 is a ________ tree.

 
Question 10 - A B-tree with the order of 4 is a ________ tree.
 
heap
 
high-order
 
2-3
 
2-4
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY