
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
JAVA CODE PLEASE
2. Insertion Sort Practice ll
by CodeChum Admin
Write a program that continuously accepts integer user input and assign the value in an array with a size of 100. The input process terminates if either of the following is true:
inputted value is 0
input count is greater than 100
Sort the values inside the array in ascending order using the insertion sort algorithm .
Print out the sorted values inside the pair of square brackets [ ] where the elements are separated by a comma and a space ", "
Input
1. Multiple lines containing an integer
Output
Enter·number·1:·1
Enter·number·2:·2
Enter·number·3:·3
Enter·number·4:·4
Enter·number·5:·5
Enter·number·6:·0
[1,·2,·3,·4,·5]
![9:05 PM O
×
View Lesson | Student
punp.codechum.com
Details
2. Insertion Sort Practice II
by CodeChum Admin
• inputted value is 0
• input count is greater than 100
Write a program that continuously accepts integer user
input and assign the value in an array with a size of 100.
The input process terminates if either of the following is
true:
Input
Code
Sort the values inside the array in ascending order using
the insertion sort algorithm.
Print out the sorted values inside the pair of square
brackets [] where the elements are separated by a
comma and a space ", "
Output
1. Multiple lines containing an integer
= Overview
<
59
Next: Lesson Summary
2/2
>](https://content.bartleby.com/qna-images/question/e1de6b93-60e8-476b-9a00-04353c32d971/2414434f-0b4f-459a-9f9b-4b2fa97d2485/8g7vq4_thumbnail.jpeg)
Transcribed Image Text:9:05 PM O
×
View Lesson | Student
punp.codechum.com
Details
2. Insertion Sort Practice II
by CodeChum Admin
• inputted value is 0
• input count is greater than 100
Write a program that continuously accepts integer user
input and assign the value in an array with a size of 100.
The input process terminates if either of the following is
true:
Input
Code
Sort the values inside the array in ascending order using
the insertion sort algorithm.
Print out the sorted values inside the pair of square
brackets [] where the elements are separated by a
comma and a space ", "
Output
1. Multiple lines containing an integer
= Overview
<
59
Next: Lesson Summary
2/2
>
![9:06 PM O
×
View Lesson | Student
punp.codechum.com
Details
Input
Sort the values inside the array in ascending order using
the insertion sort algorithm.
Print out the sorted values inside the pair of square
brackets [] where the elements are separated by a
comma and a space ", "
Output
Code
1. Multiple lines containing an integer
Enter number 1: 1
Enter number 2: 2
Enter number 3: 3
Enter number 4: 4
Enter number 5: 5
Enter number 6: 0
[1, 2, 3, 4, 5]
= Overview
<
59
Next: Lesson Summary
2/2 >](https://content.bartleby.com/qna-images/question/e1de6b93-60e8-476b-9a00-04353c32d971/2414434f-0b4f-459a-9f9b-4b2fa97d2485/8pm6z4e_thumbnail.jpeg)
Transcribed Image Text:9:06 PM O
×
View Lesson | Student
punp.codechum.com
Details
Input
Sort the values inside the array in ascending order using
the insertion sort algorithm.
Print out the sorted values inside the pair of square
brackets [] where the elements are separated by a
comma and a space ", "
Output
Code
1. Multiple lines containing an integer
Enter number 1: 1
Enter number 2: 2
Enter number 3: 3
Enter number 4: 4
Enter number 5: 5
Enter number 6: 0
[1, 2, 3, 4, 5]
= Overview
<
59
Next: Lesson Summary
2/2 >
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 3 steps with 1 images

Knowledge Booster
Similar questions
- Programing language is Carrow_forwardMatrix Addition• Write an addition function that accepts two 2D numpy arrays, andreturns the sum of the two (if they are the same size). This functionshould test that the arrays are the same size before performing theaddition. If the arrays are not the same size, the function shouldreturn -1. solve in pythonarrow_forwardProgramming language: Processing from Java Question attached as photo Topic: Use of Patial- Full Arraysarrow_forward
- Matrix Multiplication• Write a multiplication function that accepts two 2D numpy arrays,and returns the product of the two. This function should test that thearrays are compatible (recall that the number of columns in the firstmatrix must equal the number of rows in the second matrix). Thisfunction should test the array sizes before attempting themultiplication. If the arrays are not compatible, the function shouldreturn -1. solve in pythonarrow_forwardHello, i need help and i would like explanation too and include pictures of the program too please and thank you!! in c languagearrow_forwarddata structure (java)arrow_forward
- Prompt: In Python language, write a function that applies the logistic sigmoid function to all elements of a NumPy array. Code: import numpy as np import math import matplotlib.pyplot as plt import pandas as pd def sigmoid(inputArray): modifiedArray = np.zeros(len(inputArray)) #YOUR CODE HERE: return(modifiedArray) def test(): inputs = np.arange(-100, 100, 0.5) outputs = sigmoid(inputs) plt.figure(1) plt.plot(inputs) plt.title('Input') plt.xlabel('Index') plt.ylabel('Value') plt.show() plt.figure(2) plt.plot(outputs,'Black') plt.title('Output') plt.xlabel('Index') plt.ylabel('Value') plt.show() test()arrow_forwardPart 1 & 2) Lottery Winners Write a program that initializes an array with ten numbers (given below). Then let the player enter his or her lottery number. The program should ask the user if he/she wants to perform a linear search or binary search. (If the user chooses binary search, using one of the sorting algorithms we learned in the class, sort the array). Based on the searching algorithm payer chooses, it should print out the number of searching comparisons performed and if it was a winning number. int ticket[] = {85647, 62483, 13579, 26792, 52551, 33445, 79422, 76172, 93121, 26791 };\ Microsoft Visual Studio Debug Console Enter your 5-digit lottery number: 12345 Press 1 to perform linear search, 2 for binary search: 1 Original values: 85647 62483 13579 26792 52551 33445 79422 76172 93121 26791 Number of comparisons made: 10 You did not win. Microsoft Visual Studio Debug Console Enter your 5-digit lottery number: 12345 Press 1 to perform linear search, 2 for binary search: 2…arrow_forwardWrist a code to find the iterative sum of an array and the range (max and min)arrow_forward
- One dimension array in C:Create an array of 100 integer elements and initialize the array elements to zero.Populate the array (using a for loop) with the values 10,20,30,..., 990,1000.Write code (using for loops) to sum all the elements and output the sum to the screen. without using #definearrow_forward15arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY

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 Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science

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
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education

Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY