- static void BubbleSort(int[] nums)
- {
- int temp;
- for (int i = 0; i <= nums.Length -1; i++)
- {
- for (int j = 0; j <= nums.Length - 1 - i; j++)
- {
- if (nums[j] > nums[j + 1])
- {
- temp = nums[j];
- nums[j] = nums[j + 1];
- nums[j + 1] = temp;
- }
- }
- }
- }
冒泡排序 .
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.