Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Compare the performance by computing the time (in hrs, min, sec) taken by two machines A and B. A executes 108 instr./sec and B executes

  1. Compare the performance by computing the time (in hrs, min, sec) taken by two machines A and B. A executes 108 instr./sec and B executes 105 instr./sec. A runs bubble sort with c1=5 and B runs insertion sort with c2=5. Both are given an array of sorted input of size 1 billion numbers.

  1. Is the following sorting algorithm stable. Give exact reason for your answer.

for i=1 upto n-1

for j=n downto i+1

if(A[j]

Swap A[j] with A[j-1]

  1. Prove or disprove the following: 4n2-5n+3 is O(n)

  1. Sorting the following array A using MergeSort goes through the following intermediate sequence ordered from 1 to 7. Identify and fix if you find any problem in this timing sequence. A = [9, 4, 8, 1, 7, 3, 5, 2]

Time sequence:

  1. [4, 9, 8, 1, 7, 3, 5, 2]

  1. [4, 9, 1, 8, 7, 3, 5, 2]

  1. [1, 4, 8, 9, 7, 3, 5, 2]

  1. [1, 4, 8, 9, 3, 7, 5, 2]

  1. [1, 3, 4, 7, 8, 9, 5, 2]

  1. [1, 3, 4, 7, 8, 9, 2, 5]

  1. [1, 2, 3, 4, 5, 7, 8, 9]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Handbook Of Relational Database Design

Authors: Candace C. Fleming, Barbara Von Halle

1st Edition

0201114348, 978-0201114348

More Books

Students also viewed these Databases questions