HACKIS - Hacking Internet Security
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Tuyệt Kỹ Đong Giai Chân Kinh (tuyệt Kỹ cua trai)
Bubble Sort EmptyThu Aug 23, 2012 5:38 am by Admin

» Tuyệt kỹ cua giai
Bubble Sort EmptyThu Aug 23, 2012 5:36 am by Admin

» NETCAT.........
Bubble Sort EmptyMon Aug 13, 2012 6:35 am by Admin

» Bảo mật CSDL bằng phương pháp mã hóa.
Bubble Sort EmptyTue Apr 17, 2012 10:04 pm by Admin

» Hàm mã hóa MD5 bằng JavaScript
Bubble Sort EmptyTue Apr 17, 2012 10:03 pm by Admin

» Giá của món quà
Bubble Sort EmptyFri Apr 13, 2012 6:01 am by Admin

» Sẽ chỉ yêu ai?
Bubble Sort EmptyFri Apr 13, 2012 6:01 am by Admin

» Cách đọc bảng chữ cái!
Bubble Sort EmptyThu Apr 12, 2012 10:37 pm by Admin

» Gắn trojan, keylog, virus vào website, forum
Bubble Sort EmptyTue Apr 10, 2012 1:14 am by Admin

Affiliates
free forum


Bubble Sort

Go down

Bubble Sort Empty Bubble Sort

Post  Admin Sun Jun 12, 2011 9:50 am

Đây là giải thuật mà các bạn thường sử dụng vì tính dễ hiểu và dễ cài đặt của nó. Chúng ta sẽ cho những phần tử nhỏ sẽ nổi lên trên, nên thường gọi là giải thuật sắp xếp nổi bọt.
Giải thuật này tôi không bàn nhiều:

Code:
for(int i = 0; i< array.length; i++){
            for (int j = array.length - 1; j > 0; j--) {
              if(array[j] < array[j-1]){
                  int temp = array[j];
                  array[j] = array[j-1];
                  array[j-1] = temp;
              }
            }   
        }
Admin
Admin
Admin

Tổng số bài gửi : 782
Join date : 2009-08-15

https://hackis.forumvi.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum