JAVA-Record-05)AIM: Write a Java program for sorting a given list of names in ascending order

 05)AIM: 

Write a Java program for sorting a given list of names in ascending order

Algorithm  

Step1: Start

Step2: Read: Take N Inputs for Array DATA

Step3: [Sorting Array in Ascending Order]

Repeat for i = 1 to N by 1

Repeat for j = i + 1 to N by 1

If DATA[ i ] > DATA[ j ] then:

            [Swapping is Done Here]

Set: Temp = DATA[ i]

Set: DATA[ i ] = DATA[ j ]

Set: DATA[ j ] = DATA[ i ]

[End of If Structure]

[End of inner for loop]

[End of outer for loop]

Step4: Print: Sorted Array DATA[ 1:N]

Step5: Stop.

Flow Chart:

Selection Sort Flowchart or Flowchart of Selection Sort

 Code:05

Output:01

 

 

 

 

 

 

 

 

 

 

 

 

 

Comments

Popular posts from this blog

SOFTWARE

Unit 2: Foundations of Ownership, Security Related Concepts in Blockchain

Unit-1 Foundations of Software Systems and Blockchain

6)what are the various service of internet and protocols ICT-unit-1

digital marketing ppt-u1

Unit-III: Cascading Style Sheets (CSS) - HTML

Unit-V: Image Manipulations, Audio and Video & Introduction to JavaScript

Unit-II: HTML Coding Standards & Elements

HTML Degree Unit-1

1) Information and Communication Technology ICT-unit-1