Computer Science > Research Paper > University of the People - JAVA CS 1103 PRWritten Assignment Unit 1 (All)

University of the People - JAVA CS 1103 PRWritten Assignment Unit 1

Document Content and Description Below

This week's assignment is Part 1: Benchmarking Sorting Algorithms from Lab 2 of this unit. Below are the code I used to test the speed of the two sorting methods. To test the time of 1000, 10000, a... nd 100000 long arrays I simply added 0 to the necessary places instead of writing a new line of code for it. The sorting functions are copied from chapter 7.4 of the textbook with a few variables changed here and there. import java.lang.Math; public class Trial1 { public static void main(String[] args) { //================================================================= ====== //creating two integer arrays with 10 slots each int a[] = new int[1000]; int b[] = new int[1000]; // using while loop to create random number and inserting it into both arrays. int i = 0; while(i != 1000) //while i is not equal to 1000 { int an = (int) (Math.random()*1000); //generate number between 0 and 1000 a[i] = an; //inserting number in to array a int bn = (int) (Math.random()*1000);//generate number between 0 and 1000 b[i] = bn; //inserting number in to array b i++; //+1 to i [Show More]

Last updated: 2 years ago

Preview 1 out of 6 pages

Buy Now

Instant download

We Accept:

We Accept
document-preview

Buy this document to get the full access instantly

Instant Download Access after purchase

Buy Now

Instant download

We Accept:

We Accept

Reviews( 0 )

$6.00

Buy Now

We Accept:

We Accept

Instant download

Can't find what you want? Try our AI powered Search

458
0

Document information


Connected school, study & course


About the document


Uploaded On

Apr 10, 2021

Number of pages

6

Written in

Seller


seller-icon
Muchiri

Member since 4 years

209 Documents Sold

Reviews Received
19
5
1
1
6
Additional information

This document has been written for:

Uploaded

Apr 10, 2021

Downloads

 0

Views

 458

Document Keyword Tags

Recommended For You

Get more on Research Paper »

$6.00
What is Scholarfriends

In Scholarfriends, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.

We are here to help

We're available through e-mail, Twitter, Facebook, and live chat.
 FAQ
 Questions? Leave a message!

Follow us on
 Twitter

Copyright © Scholarfriends · High quality services·