sleep sort ã¨ããã½ã¼ãã¢ã«ã´ãªãºã ã話é¡ã«ãªã£ã¦ã¾ããã 常èãè¦ãã½ã¼ãã¢ã«ã´ãªãºã ï¼ãã®åã"sleep sort"ï¼ æè¿ Java ã®ãã«ãã¹ã¬ããã®åå¼·ãå§ããã®ã§ã試ãã« Java 㧠sleep sort ãæ¸ãã¦ã¿ã¾ãã final int[] array = { 5, 3, 6, 3, 6, 3, 1, 4, 7 }; for (int i = 0; i < array.length; i++) { final int index = i; new Thread() { public void run() { try { Thread.sleep(array[index] * 10); System.out.print(array[index] + ", "); } catch (InterruptedException e) { } }; }.start()
{{#tags}}- {{label}}
{{/tags}}