About 454,000 results
Open links in new tab
  1. Java : Sort integer array without using Arrays.sort ()

    Write JAVA program that will input 10 integer values and display either in ascending or descending order. Note: Arrays.sort() is not allowed. This is the code I have come up with, it works but it has one obvious flaw.

  2. ascending sort without using arrays in java - Stack Overflow

    This code has to enter 5 integers and then display them in ascending and descending orders without using arrays. But it gives me only the biggest number. How can i do it without arrays??

  3. How to Sort an Array in Java Without Using the Sort() Method

    Feb 12, 2024 · In this article, we explore how to sort arrays in Java without using the sort function and delve into five distinct methods—Bubble Sort, Selection Sort, Insertion Sort, Merge Sort, and Quicksort. Each of these methods showcases diverse approaches to array sorting, shedding light on their unique characteristics and helping developers build a ...

  4. java - Manually Sorting an Array in Ascending Order - Stack Overflow

    Dec 4, 2016 · Obviously, this is to be done manually without using any kind of sort() function. I figured to do it, I would need two for loops: the first one will loop through the existing array and create a temporary value with the value and index of the array.

  5. How to Sort an Array in Java - Tpoint Tech

    In this section, we will learn how to sort array in Java in ascending and descending order using the sort() method and without using the sort() method. Along with this, we will also learn how to sort subarray in Java .

  6. Java Program to Sort Array in Ascending Order - Tutorial …

    In this article, we show you How to write a Java Program to Sort Array in Ascending Order without Built-in and using a Sort function.

  7. java - how to sort numbers without arrays - Stack Overflow

    Jul 3, 2018 · I want to sort numbers without using Arrays. I have this: Scanner s = new Scanner(System.in); System.out.print("Input 3 numbers: "); int a = s.nextInt(); int b = s.nextInt(); int c = s.nextInt(); System.out.print("Increscent: "); if (a >= b) { . int temp; . temp = a; a = b; b = temp; if (c < a) . System.out.println(c + " " + a + " " + b);

  8. Java Program to Sort the Elements of an Array in Ascending Order

    Nov 14, 2024 · Here, we will sort the array in ascending order to arrange elements from smallest to largest, i.e., ascending order. So the easy solution is that we can use the Array.sort method. We can also sort the array using Bubble sort.

  9. How to Sort an Array in Java Without Using the sort() Method

    Dec 27, 2023 · While Java provides the convenient Arrays.sort() method to sort arrays, it‘s also useful to understand how sorting algorithms work under the hood. In this comprehensive guide, we‘ll explore several methods to sort arrays in Java without using the built-in sort() method.

  10. How to Sort an Array in Ascending Order in Java - JavaBeat

    Mar 31, 2024 · Sorting an Array in Ascending Order Without Using the sort() Method. Use one of the following sorting algorithms to arrange an array in ascending order(without using the built-in “sort()” method): Method 1: Using Bubble Sort; Method 2: Using Selection Sort; Method 3: Using Merge Sort; Method 4: Using Insertion sort; Method 5: Using Quick sort

  11. Some results have been removed
Refresh