From bc1a1bc73c0867afbcecbc9337168a216c6bc29b Mon Sep 17 00:00:00 2001 From: Christeena Date: Mon, 31 Oct 2022 16:03:07 +0530 Subject: [PATCH 1/3] Add.Bubble Sort --- Java/BubbleSort.java | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Java/BubbleSort.java diff --git a/Java/BubbleSort.java b/Java/BubbleSort.java new file mode 100644 index 00000000..98da96fc --- /dev/null +++ b/Java/BubbleSort.java @@ -0,0 +1,32 @@ +import java.util.Scanner; +public class BubbleSort +{ + public static void main(String[] args) + { + int i, j, x; + Scanner s = new Scanner(System.in); + System.out.print("Enter the size of the array : "); + int n = s.nextInt(); + int[] array = new int[n]; + System.out.print("Enter the Elements : "); + for(i=0; iarray[j+1]) + { + x = array[j]; + array[j] = array[j+1]; + array[j+1] = x; + } + } + } + System.out.println("The sorted array is:"); + for(i=0; i Date: Mon, 31 Oct 2022 16:17:12 +0530 Subject: [PATCH 2/3] Add. Linear Search --- Java/LinearSearch.java | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Java/LinearSearch.java diff --git a/Java/LinearSearch.java b/Java/LinearSearch.java new file mode 100644 index 00000000..c7fc00e2 --- /dev/null +++ b/Java/LinearSearch.java @@ -0,0 +1,31 @@ +import java.util.Scanner; +public class LinearSearch +{ + public static void main(String[] args) + { + int i, num, pos=0; + Scanner s = new Scanner(System.in); + System.out.print("Enter the size of the array : "); + int n = s.nextInt(); + int[] arr = new int[n]; + System.out.print("Enter the Values: "); + for(i=0; i Date: Mon, 31 Oct 2022 16:22:15 +0530 Subject: [PATCH 3/3] Add. Right Triangle Star Pattern --- Java/StarPattern.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Java/StarPattern.java diff --git a/Java/StarPattern.java b/Java/StarPattern.java new file mode 100644 index 00000000..bd861f3d --- /dev/null +++ b/Java/StarPattern.java @@ -0,0 +1,15 @@ +public class StarPattern +{ +public static void main(String args[]) +{ +int i, j, row=6; +for(i=0; i