What is the efficiency of insertion sort

Assignment Help JAVA Programming
Reference no: EM131145190

Regarding the JAVA langauge consider the following questions about sorting:

1: What is the efficiency of insertion sort? (pick one) a. O( n ) b. O(n2) c. O(1) d. O(n logn)

2: Consider selection sort and insertion sort and how much memory these algorithms need in proportion to the size of the array. In other words, do not consider memory required for single variables or looping variables, only memory that is directly proportional to the array. Which of the following is true? (pick one) a. selection sort requires more additional memory than insertion sort. b. insertion sort requires more additional memory than selection sort. c. both selection and insertion sort require the same amount of additional memory. d. neither selection nor insertion sort require additional memory.

3: What is the base case for the recursive merge sort algorithm? (pick one) a. any array that is already sorted. b. a one-element array. c. a zero-element array. d. a two-element array.

4: What is the efficiency of merge sort? (pick one) a. O(1) b. O(n logn) c. O(log n) d. O( n ) e. O(n2)

5: Which of the following sorting algorithms is the fastest? a. selection sort. b. insertion sort. c. merge sort. d. they all run at roughly the same speed.

Reference no: EM131145190

Questions Cloud

Regarding marketing segmentation and target markets : After reading the chapters and lecture notes regarding marketing segmentation and target markets, select one of the following product categories (cars, trucks, SUV’s, shoe stores, men’s or women’s clothing stores, computers, beer, headphones, or fitn..
What is the contents of the array : What is the contents of the array after the first pass of insertion sort - what is the contents of the array after the second pass of insertion sort?
Complete a trend analysis utilizing the income statement : The student should complete a trend analysis utilizing the Income Statement, Balance Sheet, and Cash Flow for the organization. A basic analysis of what trends are developing and why. Minimum of 5 items.
Calculate the unit price of each of the following : Calculate the Unit price of each of the following
What is the efficiency of insertion sort : What is the efficiency of insertion sort - What is the base case for the recursive merge sort algorithm?
Identify a targeted audience within good health hospital : Analyze Good Health Hospital's records and itemize recent nosocomial infections that occurred within the past year. In your report, categorize the different parameters (i.e., person, time, place, ethnicity, and gender) used in the compilation of d..
Describe and explain in deatail what accountability : Describe and explain in deatail what Accountability is. What implications are there for a company and managers involved? Please provide references is any used.
Prepare a short planning proposal for improving an condition : Prepare a short planning proposal (one single-spaced page in memo format) for improving an unsatisfactory condition on the job or in the college program you are currently involved in.
What process-performance management : Describe and explain in detail what Process/Performance Management is. What implications are there for the company and managers involved? Please provide references is any used.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Create the investment calculator

Create the following GUI that allows a user to calculate the value of an investment after a certain number of years with monthly compound interest.

  Write a main method that reads in a single string

Write a main method that reads in a single string and calls trianglePrint with that string. Write a method that uses recursion to print an input string in the shape of a triangle

  Application that calculates and displays the total payable

Write a java application that calculates and displays the total payable after applying discount on online grocery orders for N customers. The N should be set as a constant (final) in your application and choose a value between 7 and 9.

  Tutorial on taking a screen shot

If you need a tutorial on taking a screen shot, visit one of the following locations: (PC users: http://www.take-a-screenshot.org/) (MAC users: http://binged.it/1xriOcN).

  Write servlet code for accepting two numbers from user

Write the servlet code for accepting two numbers from user show addition and multiplication of numbers. If error occurs, then call JSP error page to display suitable error message.

  Create a java class called student

Create a Java class called student with the following instance variables: private String studentName

  Prepare a program to triple each number in the list

Write a program that will read in a list of numbers, triple each number in the list and print the result - Write a program that will read in 2 numbers per line, and print the sum.

  Create java program to simulate the operation of a bank atm

write a Java program to simulate the operation of a bank ATM (cashpoint) system for payment and deposit on an account. In order to make the system fairly simple there is only one bank account and there are 5 cards that can be used to deposit or wi..

  Why wont the following given program compile

Why won't the following program compile? Correct it so that it will compile and properly implement Comparable

  Multiplexors whose control bit allows you

Design a 4-bit up/down counter that has 2 to 1 multiplexors whose control bit allows you to select between one of two counting modes up or down

  Create a constructor in the subclass why

Assume there is a base class with multiple constructors, if the subclass inherits from the base class, do we need to create a constructor in the subclass? Why?

  String that contains at least five letters

Write an application that prompts the user for a String that contains at least five letters and at least five digits. Continuously reprompt the user until a valid String is entered. Display a message indicating whether the user was successful or did ..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd