FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
code-backup/5th_sem_C_Java_VB/Java/Package/xxpackage2.java at master · Jimut123/code-backup · GitHub
This repository was archived by the owner on Jul 28, 2024. It is now read-only.
Jimut123
/
code-backup
Public archive
Notifications
You must be signed in to change notification settings
Fork
6
Star
20
Code
Issues
0
Pull requests
35
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
code-backup
/
5th_sem_C_Java_VB
/
Java
/
Package
/
xxpackage2.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
37 lines (37 loc) · 1.13 KB
Breadcrumbs
code-backup
/
5th_sem_C_Java_VB
/
Java
/
Package
/
xxpackage2.java
Copy path
File metadata and controls
37 lines (37 loc) · 1.13 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//xxpackage2.java : Write main program to use sorting
import
java
.
io
.*;
import
package_sorting
.
Sorting
;
class
xxpackage2
{
public
static
void
main
(
String
args
[])
throws
IOException
{
int
a
[] =
new
int
[
10
];
int
i
,
n
;
BufferedReader
br
=
new
BufferedReader
(
new
InputStreamReader
(
System
.
in
));
int
choice
;
System
.
out
.
print
(
"
\n
Enter size of your list(1-10) = "
);
n
=
Integer
.
parseInt
(
br
.
readLine
());
System
.
out
.
println
(
"
\n
Enter "
+
n
+
" elements one by one--->"
);
for
(
i
=
0
;
i
<
n
;
i
++)
{
System
.
out
.
print
(
"a["
+(
i
+
1
)+
"] = "
);
a
[
i
]=
Integer
.
parseInt
(
br
.
readLine
());
}
System
.
out
.
println
(
"Unsorted List"
);
for
(
i
=
0
;
i
<
n
;
i
++)
System
.
out
.
print
(
a
[
i
]+
"
\t
"
);
Sorting
s
=
new
Sorting
();
System
.
out
.
println
();
do
{
System
.
out
.
println
(
"
\n
Type 1 for Bubble Sort"
);
System
.
out
.
println
(
"Type 2 for Insertion Sort"
);
System
.
out
.
print
(
"Type any other number to exit : "
);
choice
=
Integer
.
parseInt
(
br
.
readLine
());
if
(
choice
==
1
)
s
.
bubble
(
a
,
n
);
if
(
choice
==
2
)
s
.
insertion
(
a
,
n
);
}
while
(
choice
==
1
||
choice
==
2
);
}
}
Back
|
FazBrowse Home
|
New Git URL