{
  "type": "code_options",
  "author": "csdn.net",
  "source": "solution.md",
  "exercise_id": "c2629a9c980e4fd6a5da7c8179b0363f",
  "keywords": "图算法,算法高阶,最小生成树,最小生成树的形成",
  "title": "数组排序",
  "desc": [
    {
      "content": "\n<p>编写一个JavaApplication程序,将随机生成的无序数组使用冒泡排序,将这个混乱的数组变成一个从小到大排列的有序的数组并输出。</p>",
      "language": "markdown"
    }
  ],
  "answer": [
    {
      "content": "",
      "language": "java"
    }
  ],
  "prepared": [
    [
      {
        "content": "",
        "language": "java"
      }
    ],
    [
      {
        "content": "",
        "language": "java"
      }
    ],
    [
      {
        "content": "",
        "language": "java"
      }
    ]
  ],
  "template": {
    "content": "class demo_sort {\n\tpublic static void main(String[] args) {\n\t\tint[] numbers = new int[] { 1, 5, 8, 2, 3, 9, 4 };\n\t\tfor (int i = 0; i < numbers.length - 1; i++) {\n\t\t\tfor (int j = 0; j < numbers.length - 1 - i; j++) {\n\t\t\t\tif (numbers[j] > numbers[j + 1]) {\n\t\t\t\t\tint temp = numbers[j];\n\t\t\t\t\tnumbers[j] = numbers[j + 1];\n\t\t\t\t\tnumbers[j + 1] = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"从小到大排序后的结果是:\");\n\t\tfor (int i = 0; i < numbers.length; i++)\n\t\t\tSystem.out.print(numbers[i] + \" \");\n\t}\n}",
    "language": "java"
  },
  "node_id": "dailycode-9f809286599941568b67aa96b36c603d",
  "license": "csdn.net",
  "created_at": 1637894160,
  "topic_link": "https://bbs.csdn.net/topics/600470289"
}