0% found this document useful (0 votes)
3 views1 page

Insert Element in Sorted Array Program

The document outlines a program designed to insert a new element into an existing integer array. It specifies the steps for entering and sorting the array, adding a new value while maintaining the sorted order, and displaying the results. User interface expectations and guidelines for the program's functionality are also provided.

Uploaded by

tolathuyquyen
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

Insert Element in Sorted Array Program

The document outlines a program designed to insert a new element into an existing integer array. It specifies the steps for entering and sorting the array, adding a new value while maintaining the sorted order, and displaying the results. User interface expectations and guidelines for the program's functionality are also provided.

Uploaded by

tolathuyquyen
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Title

Program to insert new element into an existing array.


Background Context
Insert new element into an existing array

Program Specifications
Create a program to insert new element into an existing array

Function details:
1. Enter an integer array
2. Sort array in ascending and display the sorted array on the screen
3. Enter new integer value
4. Add new value entered to the sorted array in ascending order and then display new array on the screen
5. Finish program

Expectation of User interface:


The Program must have interface as below:

Please enter size of array: 5


Enter element[0]: 13
Enter element[1]: 3
Enter element[2]: 5
Enter element[3]: 10
Enter element[4]: 8
The array after sorting:
3 5 8 10 13
Please enter new value: 9
New array:
3 5 8 9 10 13

Guidelines
Restrict: When insert new element into sorted array you don’t allow sorting the array again.

You might also like