In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the relevant knowledge of "what are the sorting methods of java arrays". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Preface
When using array sorting function in JAVA, there are generally four methods: fast sorting method, bubble sorting method, selective sorting method and insertion sorting method.
The methods are as follows:
1. Quick sort: first of all, the simplest Array.sort is sorted directly:
Public static void main (String [] args) {int [] arr = {4 System.out.println [] arr = {4 int I: arr) {System.out.println (I);}
Click run to output the sorted array numbers.
2, partial sorting method: you can also use Array.sort to select some of the numbers you want to sort, such as sorting the numbers with the subscript number 1: 4, and the order of other numbers remains the same.
Public static void main (String [] args) {int [] arr = {4, int, 3, arr, 1, 2, 9, 3, 0}; Arrays.sort (arr,1,4); for (int I = 0 Tinci)
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.