Question Details

[solution]: 8. You have 82 observations with which to estimate a regression


Answer download
More Details:

Deadline: Saturday 5/03/2016 at 11:59 pm

Submission has to be made via the submission folder on Blackboard.

No Email Submission will be accepted.

Late submission will result in ZERO marks.

Identical submission will result in ZERO marks.


CS-141 Java programming II

 

ASSIGNMENT 2 worth 5 point

 


 

Deadline: Saturday 5/03/2016 at 11:59 pm

 

Submission has to be made via the submission folder on Blackboard.

 

No Email Submission will be accepted.

 

Late submission will result in ZERO marks.

 

Identical submission will result in ZERO marks.

 


 

Short Answer Questions

 


 

Q1. (0.5 point) (a)Write the java code for doing a Linear Search on the array given

 

below.

 

Write your code in the space below, (no need to submit .java file)

 


 

(b) What would your search method return if we asked to search for the number 2 and

 

return it?s index position?

 

[24][2][45][20]56][75][2][56][99][53][12]

 


 

Q2. (0.5 points) Calculate the Big Oh performance for the following:

 

Given that an Array of size n=10 takes 3 seconds to search,

 

how long does it take a search Array of size n=100?

 

(a)Linear Search of an array of size n=100

 


 

Given O(n)

 


 

(b) Merge Sort performance of an array is O(nlog(n)),

 

given that an Array of size n=10 takes 3 seconds to sort,

 

how long does it take to sort an Array of size n=100?

 


 

Q3. (2 points)

 

(a) Convert the following iterative method to recursive method.

 

(b) What is the advantage and disadvantage of using recursion?

 

Write your code in the space below, (no need to submit .java file)

 

public
static
int
factorialIterative(int
n)
{

 



int
res
=
1;

 



while
(n
>
0)
{

 





res
=
res
*
n;

 





n-­?-­?;

 



}

 



return
res;

 

}

 


 

Q4. (2 points) Write a program where you use Selection Sort to sort the following array

 

in ascending order.

 

24,2,45,20,56,75,2,56,99,53,12

 


 

a) Declare an array of integers called unsortedarr and load it with the integers

 

above. Notice we have 11 numbers, and the number 2 is repeated which is

 

fine.

 

Display the array as it is by printing it before the sort.

 

b) Sort the array using the insertion sort technique and display the array after you sort it.

 


 

Here is the beginning of the code, complete it, run it, test it, submit it.

 


 

import java.util.*;

 


 

public class MySelectSort {

 

public static void main(String args) {

 

int arr = {24,2,45,20,56,75,2,56,99,53,12};

 

System.out.println("-------------------------- unsorted");

 

System.out.println(arr);

 


 

// continue ? write your code

 


 

 


Solution details:
STATUS
Answered
QUALITY
Approved
ANSWER RATING

This question was answered on: Dec 18, 2020

PRICE: $18.50

Solution~00031148034012.zip (25.37 KB)

Buy this answer for only: $18.50

This attachment is locked

We have a ready expert answer for this paper which you can use for in-depth understanding, research editing or paraphrasing. You can buy it or order for a fresh, original and plagiarism-free copy (Deadline assured. Flexible pricing. TurnItIn Report provided)

Pay using PayPal (No PayPal account Required) or your credit card . All your purchases are securely protected by .
SiteLock

About this Question

STATUS

Answered

QUALITY

Approved

DATE ANSWERED

Dec 18, 2020

EXPERT

Tutor

ANSWER RATING

GET INSTANT HELP/h4>

We have top-notch tutors who can do your essay/homework for you at a reasonable cost and then you can simply use that essay as a template to build your own arguments.

You can also use these solutions:

  • As a reference for in-depth understanding of the subject.
  • As a source of ideas / reasoning for your own research (if properly referenced)
  • For editing and paraphrasing (check your institution's definition of plagiarism and recommended paraphrase).
This we believe is a better way of understanding a problem and makes use of the efficiency of time of the student.

NEW ASSIGNMENT HELP?

Order New Solution. Quick Turnaround

Click on the button below in order to Order for a New, Original and High-Quality Essay Solutions. New orders are original solutions and precise to your writing instruction requirements. Place a New Order using the button below.

WE GUARANTEE, THAT YOUR PAPER WILL BE WRITTEN FROM SCRATCH AND WITHIN YOUR SET DEADLINE.

Order Now