{"id":11191,"date":"2016-08-08T09:00:59","date_gmt":"2016-08-08T00:00:59","guid":{"rendered":"http:\/\/www.techscore.com\/blog\/?p=11191"},"modified":"2018-11-14T16:33:45","modified_gmt":"2018-11-14T07:33:45","slug":"%e9%96%8b%e7%99%ba%e6%96%b0%e5%8d%92%e3%81%ab%e6%8d%a7%e3%81%90%e3%80%81%e5%9f%ba%e6%9c%ac%e3%81%ae%e3%82%a2%e3%83%ab%e3%82%b4%e3%83%aa%e3%82%ba%e3%83%a0%e3%81%a8%e8%a8%88%e7%ae%97%e9%87%8f","status":"publish","type":"post","link":"https:\/\/www.techscore.com\/blog\/2016\/08\/08\/%e9%96%8b%e7%99%ba%e6%96%b0%e5%8d%92%e3%81%ab%e6%8d%a7%e3%81%90%e3%80%81%e5%9f%ba%e6%9c%ac%e3%81%ae%e3%82%a2%e3%83%ab%e3%82%b4%e3%83%aa%e3%82%ba%e3%83%a0%e3%81%a8%e8%a8%88%e7%ae%97%e9%87%8f\/","title":{"rendered":"\u958b\u767a\u65b0\u5352\u306b\u6367\u3050\u3001\u57fa\u672c\u306e\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3068\u8a08\u7b97\u91cf"},"content":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3002\u4e00\u677e\u3067\u3059\u3002<br \/>\n\u524d\u56de\u306eSQL\u306e\u57fa\u672c\u306b\u7d9a\u304d\u3001\u4eca\u56de\u306f\u57fa\u672c\u3068\u3057\u3066\u8eab\u306b\u4ed8\u3051\u3066\u304a\u304d\u305f\u3044\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306b\u3064\u3044\u3066\u66f8\u304d\u307e\u3059\u3002<br \/>\n\u306f\u3058\u3081\u306e\u4e00\u6b69\u3068\u3057\u3066\u3001\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3092\u77e5\u308b\u4e0a\u3067\u5fc5\u8981\u306a\u8a08\u7b97\u91cf\u3068\u3044\u3046\u8003\u3048\u65b9\u3068\u4ee3\u8868\u7684\u306a\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306e\u7279\u5fb4\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002\u307e\u305f\u3001\u3053\u308c\u3092\u8e0f\u307e\u3048\u3066\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u304f\u969b\u306e\u6ce8\u610f\u70b9\u3092\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n<h2>\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3068\u306f<\/h2>\n<p>\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3068\u306f\u554f\u984c\u3084\u8ab2\u984c\u3092\u89e3\u6c7a\u3059\u308b\u305f\u3081\u306e\u51e6\u7406\u624b\u9806\u3092\u3082\u308c\u306a\u304f\u8868\u73fe\u3057\u305f\u8003\u3048\u65b9\u306e\u3053\u3068\u3067\u3059\u3002\u3053\u306e\u51e6\u7406\u624b\u9806\u306e\u8003\u3048\u65b9\u306f\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u4e16\u754c\u3060\u3051\u3067\u306a\u304f\u3001\u307f\u306a\u3055\u3093\u306e\u65e5\u5e38\u306b\u3082\u4f7f\u308f\u308c\u3066\u3044\u307e\u3059\u3002<br \/>\n\u4f8b\u3048\u3070\u3001\u300c\u96e8\u304c\u964d\u3063\u3066\u3044\u305f\u3089\u5098\u3092\u6301\u3063\u3066\u51fa\u304b\u3051\u308b\u3001\u96e8\u304c\u964d\u3063\u3066\u3044\u306a\u304b\u3063\u305f\u3089\u5098\u3092\u6301\u305f\u305a\u306b\u51fa\u304b\u3051\u308b\u300d\u3001\u3053\u308c\u3082\u77ed\u3044\u3067\u3059\u304c\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3067\u3059\u3002\u3082\u3046\u5c11\u3057\u9577\u3044\u3082\u306e\u3060\u3068\u6599\u7406\u306e\u30ec\u30b7\u30d4\u3082\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306e\u4e00\u7a2e\u3068\u3044\u3048\u308b\u3067\u3057\u3087\u3046\u3002\u624b\u9806\u3092\u3072\u3068\u3064\u305a\u3064\u884c\u3046\u3053\u3068\u3067\u304a\u3044\u3057\u3044\u6599\u7406\u304c\u5b8c\u6210\u3057\u307e\u3059\u306d\u3002\u4ed6\u306b\u3082\u30c8\u30e9\u30f3\u30d7\u3092\u7d75\u67c4\u3054\u3068\u6570\u5b57\u306e\u5c0f\u3055\u3044\u9806\u306b\u4e26\u3073\u66ff\u3048\u308b\u3053\u3068\u3082\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3092\u5143\u306b\u8003\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\n\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u304a\u3051\u308b\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306e\u4ee3\u8868\u7684\u306a\u3082\u306e\u306b\u30bd\u30fc\u30c8\uff08\u4e26\u3073\u66ff\u3048\uff09\u3068\u63a2\u7d22\u304c\u3042\u308a\u307e\u3059\u3002\u8eab\u8fd1\u306a\u3068\u3053\u308d\u3067\u306f\u3001\u30b7\u30e7\u30c3\u30d4\u30f3\u30b0\u30b5\u30a4\u30c8\u3067\u4fa1\u683c\u3092\u57fa\u6e96\u306b\u4e26\u3073\u66ff\u3048\u3092\u884c\u3046\u3068\u304d\u306b\u4f7f\u308f\u308c\u308b\u3082\u306e\u304c\u30bd\u30fc\u30c8\u3001\u691c\u7d22\u30a8\u30f3\u30b8\u30f3\u3067\u76ee\u7684\u306e\u30b5\u30a4\u30c8\u3092\u63a2\u3059\u3068\u304d\u306b\u4f7f\u308f\u308c\u308b\u3082\u306e\u304c\u63a2\u7d22\u3067\u3059\u3002<\/p>\n<h2>\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3068\u8a08\u7b97\u91cf<\/h2>\n<p>\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306b\u306f\u7d50\u679c\u304c\u51fa\u308b\u307e\u3067\u306b\u304b\u304b\u308b\u6642\u9593\u306e\u7279\u5fb4\u3092\u8868\u3059\u8a08\u7b97\u91cf\u3068\u3044\u3046\u8003\u3048\u65b9\u304c\u3042\u308a\u307e\u3059\u3002\u5165\u529b\u3055\u308c\u308b\u30c7\u30fc\u30bf\u91cf\u306b\u3088\u3063\u3066\u3001\u5b9f\u884c\u6642\u9593\u304c\u3069\u306e\u3088\u3046\u306a\u5272\u5408\u3067\u5909\u5316\u3059\u308b\u306e\u304b\u3092\u8868\u3059\u6307\u6a19\u3067\u3059\u3002\u5927\u304d\u304f\u308f\u3051\u308b\u30685\u30bf\u30a4\u30d7\u3042\u308a\u307e\u3059\u3002\u306a\u304a\u3001\u8a08\u7b97\u91cf\u306f\u4e00\u822c\u7684\u306b\u300cO\u8a18\u6cd5\u300d\u3068\u3044\u3046\u8868\u3057\u65b9\u3092\u3057\u307e\u3059\u3002O\u8a18\u6cd5\u3067\u306f\u62ec\u5f27\u306e\u4e2d\u306b\u8a08\u7b97\u91cf\u306e\u5897\u3048\u65b9\u306e\u7279\u5fb4\u3092\u66f8\u304d\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u30c7\u30fc\u30bf\u6570n\u306b\u5bfe\u3057\u3066\u6bd4\u4f8b\u3057\u3066\u8a08\u7b97\u91cf\u304c\u5897\u3048\u308b\u5834\u5408\u306fO(n)\u3068\u8868\u8a18\u3057\u307e\u3059\u3002<\/p>\n<p>\u30fbO(1)<br \/>\n\u30c7\u30fc\u30bf\u6570n\u306b\u304b\u304b\u308f\u3089\u305a\u4e00\u5b9a\u306a\u306e\u3067\u3001n\u304c2\u500d\u30013\u500d\u300110\u500d\u3068\u306a\u3063\u3066\u3082\u8a08\u7b97\u91cf\u306f\u7b49\u3057\u3044\u307e\u307e\u3067\u3059\u3002<\/p>\n<p>\u30fbO(n)<br \/>\n\u6bd4\u4f8b\u306a\u306e\u3067\u3001n\u304c2\u500d\u30013\u500d\u3068\u5897\u3048\u308b\u3068\u3001\u8a08\u7b97\u91cf\u3082\u540c\u69d8\u306b2\u500d\u30013\u500d\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u30fbO(log n)<br \/>\n\u8a08\u7b97\u91cf\u3092\u6c42\u3081\u308b\u5834\u5408\u306f\u5e95\u30922\u3068\u3057\u3066\u8003\u3048\u307e\u3059\u3002<br \/>\nn\u304c2\u500d\u30013\u500d\u3068\u5897\u3048\u3066\u3082\u3001\u8a08\u7b97\u91cf\u306f1\u30012\u3068\u5897\u3048\u308b\u7a0b\u5ea6\u306a\u306e\u3067\u30c7\u30fc\u30bf\u91cf\u304c\u591a\u3044\u5834\u5408\u306b\u6709\u7528\u3067\u3059\u3002<\/p>\n<p>\u30fbO(n log n)<br \/>\n\u5148\u8ff0\u306eO(log n)\u306bn\u306e\u8a08\u7b97\u91cf\u304c\u304b\u3051\u3089\u308c\u305f\u3082\u306e\u3067\u3059\u3002<br \/>\n\u4f8b\u3048\u3070\u3001n\u304c2\u500d\u306b\u306a\u308b\u3068\u8a08\u7b97\u91cf\u306f\u7d042.5\u500d\u3001n\u304c10\u500d\u306b\u306a\u308b\u3068\u8a08\u7b97\u91cf\u306f\u7d0420\u500d\u3001n\u304c100\u500d\u306b\u306a\u308b\u3068\u8a08\u7b97\u91cf\u306f\u7d04300\u500d\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u30fbO(n^2)<br \/>\n<del datetime=\"2016-08-09T05:06:57+00:00\">\u3059\u3079\u3066\u306e\u7d44\u307f\u5408\u308f\u305b\u3092\u6c42\u3081\u308b\u3088\u3046\u306a\u5834\u5408\u306f\u3053\u306e\u30d1\u30bf\u30fc\u30f3\u306b\u5f53\u3066\u306f\u307e\u308a\u307e\u3059\u3002<\/del><br \/>\nn\u500b\u306e\u8981\u7d20\u3092\u7528\u3044\u305f\u7dcf\u5f53\u308a\u306e\u7d44\u307f\u5408\u308f\u305b\u3092\u6c42\u3081\u308b\u5834\u5408\u304c\u3053\u306e\u30d1\u30bf\u30fc\u30f3\u306b\u5f53\u3066\u306f\u307e\u308a\u307e\u3059\u3002<br \/>\n<del datetime=\"2016-08-09T05:06:57+00:00\">\u6307\u6570\u95a2\u6570<\/del>\u4e8c\u6b21\u95a2\u6570\u306a\u306e\u3067\u3001n\u304c2\u500d\u30013\u500d\u3068\u5897\u3048\u308b\u3068\u3001\u8a08\u7b97\u91cf\u306f4\u500d\u30019\u500d\u3068\u5897\u3048\u307e\u3059\u3002<br \/>\n\uff08\u203b\u672c\u6587\u3092\u8a02\u6b63\u3057\u307e\u3057\u305f\u30022016\u5e748\u67089\u65e5\uff09<\/p>\n<p><a href=\"https:\/\/www.techscore.com\/blog\/wp\/wp-content\/uploads\/2016\/08\/76c691c22c7ef40a64aa64b04f05e90c.png\" rel=\"facebox\" rel=\"attachment wp-att-11234\"><img loading=\"lazy\" class=\"size-medium wp-image-11234 aligncenter\" src=\"https:\/\/www.techscore.com\/blog\/wp\/wp-content\/uploads\/2016\/08\/76c691c22c7ef40a64aa64b04f05e90c-300x186.png\" alt=\"\u7121\u984c2\" width=\"600\" height=\"372\" srcset=\"https:\/\/www.techscore.com\/blog\/wp\/wp-content\/uploads\/2016\/08\/76c691c22c7ef40a64aa64b04f05e90c-300x186.png 300w, https:\/\/www.techscore.com\/blog\/wp\/wp-content\/uploads\/2016\/08\/76c691c22c7ef40a64aa64b04f05e90c-768x475.png 768w, https:\/\/www.techscore.com\/blog\/wp\/wp-content\/uploads\/2016\/08\/76c691c22c7ef40a64aa64b04f05e90c-1024x633.png 1024w, https:\/\/www.techscore.com\/blog\/wp\/wp-content\/uploads\/2016\/08\/76c691c22c7ef40a64aa64b04f05e90c.png 1589w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>\u56f3\u3092\u898b\u3066\u3082\u308f\u304b\u308b\u901a\u308a\u3001O(n^2)\u306e\u8a08\u7b97\u91cf\u3067\u306f\u5927\u304d\u306a\u30c7\u30fc\u30bf\u3092\u6271\u3046\u3068\u3059\u3050\u306b\u73fe\u5b9f\u7684\u306a\u51e6\u7406\u6642\u9593\u3067\u306f\u306a\u304f\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002\u6b21\u306b\u7d39\u4ecb\u3059\u308b\u4ee3\u8868\u7684\u306a\u30bd\u30fc\u30c8\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306fO(n^2)\u306e\u3082\u306e\u3082\u7d39\u4ecb\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u5b9f\u7528\u7684\u3068\u306f\u8a00\u3044\u304c\u305f\u3044\u3067\u3059\u3002O(log n)\u306e\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306f\u81a8\u5927\u306a\u30c7\u30fc\u30bf\u91cf\u306b\u3082\u8010\u3048\u3046\u308b\u306e\u3067\u3001\u5927\u91cf\u306e\u30c7\u30fc\u30bf\u3092\u6271\u3046\u3088\u3046\u306a\u30b7\u30b9\u30c6\u30e0\u306b\u3082\u5c0e\u5165\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u30bd\u30fc\u30c8\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0<\/h2>\n<p>\u30bd\u30fc\u30c8\u3068\u306f\u65e5\u672c\u8a9e\u3067\u8a00\u3046\u3068\u3053\u308d\u306e\u4e26\u3073\u66ff\u3048\u306e\u3053\u3068\u3067\u3059\u3002\u5c0f\u3055\u3044\u9806\u306b\u4e26\u3079\u308b\u6607\u9806\u30bd\u30fc\u30c8\u3068\u3001\u5927\u304d\u3044\u9806\u306b\u4e26\u3079\u308b\u964d\u9806\u30bd\u30fc\u30c8\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h3>\u30d0\u30d6\u30eb\u30bd\u30fc\u30c8<\/h3>\n<p>\u96a3\u308a\u5408\u3046\u8981\u7d20\u306e\u5927\u5c0f\u3092\u6bd4\u8f03\u3057\u3066\u6574\u5217\u3055\u305b\u307e\u3059\u3002\u6607\u9806\u306b\u4e26\u3073\u66ff\u3048\u308b\u5834\u5408\u306f\u3001\u57fa\u6e96\u3068\u306a\u308b\u8981\u7d20\u3068\u96a3\u306e\u8981\u7d20\u3068\u6bd4\u8f03\u3057\u3066\u3001\u57fa\u6e96\u306e\u8981\u7d20\u306e\u307b\u3046\u304c\u5927\u304d\u3051\u308c\u3070\u5165\u308c\u66ff\u3048\u3001\u305d\u3046\u3067\u306a\u3044\u5834\u5408\u306f\u5165\u308c\u66ff\u3048\u305a\u3001\u57fa\u6e96\u3068\u306a\u308b\u8981\u7d20\u3092\u3072\u3068\u3064\u96a3\u306b\u305a\u3089\u3057\u307e\u3059\u3002\u3053\u308c\u3092\u7e70\u308a\u8fd4\u3057\u6700\u7d42\u7684\u306b\u6b63\u3057\u3044\u9806\u5e8f\u306b\u4e26\u3073\u66ff\u3048\u307e\u3059\u3002\u96a3\u306e\u8981\u7d20\u3068\u6bd4\u8f03\u3057\u3066\u8981\u7d20\u306e\u6700\u5927\u5024\uff08\u307e\u305f\u306f\u6700\u5c0f\u5024\uff09\u304c\u9806\u306b\u6c7a\u5b9a\u3055\u308c\u3066\u3044\u304f\u69d8\u5b50\u304c\u6ce1\u306e\u3088\u3046\u306a\u306e\u3067\u30d0\u30d6\u30eb\u30bd\u30fc\u30c8\u3068\u3044\u3044\u307e\u3059\u3002\u8981\u7d20\u3092\u4e26\u3073\u66ff\u3048\u308b\u305f\u3081\u306bn\u56de\u6bd4\u8f03\u3092\u3057\u3001\u3055\u3089\u306b\u3001\u305d\u306e\u6bd4\u8f03\u3092\u3059\u3079\u3066\u306e\u8981\u7d20\u3067\u884c\u3046\u5fc5\u8981\u304c\u3042\u308b\u306e\u3067\u3001\u8a08\u7b97\u91cf\u306fO(n^2)\u3067\u3059\u3002<\/p>\n<h3>\u633f\u5165\u30bd\u30fc\u30c8<\/h3>\n<p>\u307e\u305a1\u756a\u76ee\u30682\u756a\u76ee\u306e\u8981\u7d20\u3092\u6bd4\u8f03\u3057\u3001\u8981\u7d20\u306e\u9806\u756a\u304c\u9006\u306a\u3089\u3070\u3044\u308c\u304b\u3048\u3001\u6b63\u3057\u3051\u308c\u3070\u305d\u306e\u307e\u307e\u306b\u3057\u307e\u3059\u3002\u6b21\u306b3\u756a\u76ee\u306e\u8981\u7d20\u3092\u6b63\u3057\u304f\u4e26\u3093\u3067\u3044\u308b1\u756a\u76ee\u30012\u756a\u76ee\u306e\u8981\u7d20\u3068\u6bd4\u8f03\u3057\u3001\u6b63\u3057\u3044\u4f4d\u7f6e\u306b\u633f\u5165\u3057\u307e\u3059\u3002\u4ee5\u964d\u306e\u8981\u7d20\u3082\u3072\u3068\u3064\u305a\u3064\u65e2\u306b\u4e26\u3073\u66ff\u3048\u305f\u914d\u5217\u306e\u8981\u7d20\u3068\u6bd4\u8f03\u3057\u3001\u6b63\u3057\u3044\u9806\u756a\u306b\u4e26\u3076\u3088\u3046\u306b\u633f\u5165\u3059\u308b\u3053\u3068\u3092\u7e70\u308a\u8fd4\u3057\u307e\u3059\u3002\u6b63\u3057\u304f\u4e26\u3073\u66ff\u3048\u3089\u308c\u305f\u914d\u5217\u306b\u5bfe\u3057\u3066\u76f4\u63a5\u6b21\u306e\u8981\u7d20\u3092\u633f\u5165\u3059\u308b\u306e\u3067\u3001\u633f\u5165\u30bd\u30fc\u30c8\u3068\u3044\u3044\u307e\u3059\u3002\u30c7\u30fc\u30bf\u306e\u6570\u3060\u3051\u633f\u5165\u3059\u308b\u56de\u6570\u304c\u5897\u3048\u308b\u306e\u3067\u3001\u8a08\u7b97\u91cf\u306fO(n^2)\u3067\u3059\u3002<\/p>\n<h3>\u30de\u30fc\u30b8\u30bd\u30fc\u30c8<\/h3>\n<p>\u307e\u305a\u3001\u4e26\u3073\u9806\u304c\u3070\u3089\u3070\u3089\u306b\u306a\u3063\u3066\u3044\u308b\u8981\u7d20\u3092\u7e70\u308a\u8fd4\u30572\u3064\u306b\u5207\u308a\u5206\u3051\u3001\u8981\u7d20\u6570\u304c1\u306b\u306a\u308b\u307e\u3067\u5206\u89e3\u3057\u307e\u3059\u3002\u5206\u89e3\u3057\u305f\u914d\u5217\u3054\u3068\u306b\u5927\u5c0f\u3092\u6bd4\u8f03\u3057\u4e26\u3073\u66ff\u3048\u305f\u3082\u306e\u3092\u5408\u4f75\u3057\u3066\u3044\u304d\u307e\u3059\u3002\u5c0f\u3055\u304f\u5207\u308a\u5206\u3051\u305f\u30bd\u30fc\u30c8\u6e08\u306e\u8981\u7d20\u3092\u6b21\u3005\u306b\u5408\u4f75\u3057\u3066\u3001\u3059\u3079\u3066\u306e\u8981\u7d20\u3092\u6b63\u3057\u3044\u9806\u756a\u306b\u4e26\u3073\u66ff\u3048\u307e\u3059\u3002\u4e26\u3073\u66ff\u3048\u306e\u969b\u306b\u5408\u4f75\u3059\u308b\u306e\u3067\u30de\u30fc\u30b8\u30bd\u30fc\u30c8\u3068\u3044\u3044\u307e\u3059\u3002\u8a08\u7b97\u91cf\u306f\u3001\u306f\u3058\u3081\u306b\u5206\u89e3\u3059\u308b\u969b\u306b2\u3064\u306b\u5207\u308a\u5206\u3051\u3066\u3044\u304f\u306e\u3067O(log n)\u3001\u4e26\u3073\u66ff\u3048\u306e\u969b\u306b\u8981\u7d20\u306e\u6570\u3060\u3051\u6bd4\u8f03\u3092\u3059\u308b\u306e\u3067O(n)\u304b\u304b\u308a\u307e\u3059\u3002\u3088\u3063\u3066O(n log n)\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>\u63a2\u7d22\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0<\/h2>\n<p>\u63a2\u7d22\u3068\u306f\u7279\u5b9a\u306e\u6761\u4ef6\u306b\u5f53\u3066\u306f\u307e\u308b\u30c7\u30fc\u30bf\u3092\u63a2\u3057\u3060\u3059\u3053\u3068\u3067\u3059\u3002\u6c42\u3081\u308b\u8981\u7d20\u3068\u4e00\u81f4\u3059\u308b\u8981\u7d20\u304c\u898b\u3064\u304b\u308b\u307e\u3067\u63a2\u7d22\u3092\u3057\u307e\u3059\u3002<\/p>\n<h3>\u30ea\u30cb\u30a2\u30b5\u30fc\u30c1\uff08\u7dda\u5f62\u63a2\u7d22\uff09<\/h3>\n<p>\u4e00\u76f4\u7dda\u306b\u4e26\u3079\u305f\u30ea\u30b9\u30c8\u3092\u5148\u982d\u304b\u3089\u9806\u306b\u76ee\u7684\u306e\u8981\u7d20\u304b\u3069\u3046\u304b\u78ba\u8a8d\u3057\u3066\u3044\u304d\u307e\u3059\u3002\u4e00\u81f4\u3059\u308b\u8981\u7d20\u304c\u51fa\u308c\u3070\u63a2\u7d22\u7d42\u4e86\u3001\u4e00\u81f4\u3059\u308b\u8981\u7d20\u304c\u51fa\u306a\u3051\u308c\u3070\u6b21\u306e\u8981\u7d20\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002\u6700\u3082\u30b7\u30f3\u30d7\u30eb\u306a\u63a2\u7d22\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3067\u3059\u3002\u30c7\u30fc\u30bf\u91cf\u306e\u5897\u52a0\u306b\u6bd4\u4f8b\u3057\u3066\u3001\u6bd4\u8f03\u3059\u308b\u8981\u7d20\u3082\u5897\u3048\u308b\u306e\u3067\u3001\u8a08\u7b97\u91cf\u306fO(n)\u3067\u3059\u3002<\/p>\n<h3>\u30d0\u30a4\u30ca\u30ea\u30b5\u30fc\u30c1\uff08\u4e8c\u5206\u63a2\u7d22\uff09<\/h3>\n<p>\u4e88\u3081\u5bfe\u8c61\u306e\u30c7\u30fc\u30bf\u3092\u6607\u9806\u306b\u4e26\u3079\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u63a2\u3057\u305f\u3044\u30c7\u30fc\u30bf\u3068\u3001\u63a2\u3057\u305f\u3044\u914d\u5217\u306e\u4e2d\u592e\u306e\u8981\u7d20\u3068\u3092\u6bd4\u8f03\u3057\u3001\u305d\u308c\u3088\u308a\u3082\u5927\u304d\u3044\u306e\u304b\u5c0f\u3055\u3044\u306e\u304b\u306b\u3088\u3063\u3066\u3001\u6b21\u56de\u63a2\u3059\u7bc4\u56f2\u3092\u7d5e\u308a\u8fbc\u307f\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u76ee\u7684\u306e\u8981\u7d20\u304c\u4e2d\u592e\u306e\u8981\u7d20\u3088\u308a\u5927\u304d\u3051\u308c\u3070\u3001\u5927\u304d\u3044\u65b9\u306e\u534a\u5206\u306e\u30ea\u30b9\u30c8\u3092\u5bfe\u8c61\u306b\u518d\u5ea6\u4e2d\u592e\u306e\u8981\u7d20\u3092\u78ba\u8a8d\u3057\u3001\u76ee\u7684\u306e\u8981\u7d20\u3068\u6bd4\u8f03\u3057\u307e\u3059\u3002\u3053\u306e\u3088\u3046\u306b\u534a\u5206\u305a\u3064\u7d5e\u308a\u8fbc\u3093\u3067\u76ee\u7684\u306e\u8981\u7d20\u3092\u898b\u3064\u3051\u308b\u65b9\u6cd5\u3067\u3059\u3002\u4e2d\u592e\u306e\u8981\u7d20\u304c\u63a2\u3057\u305f\u3044\u30c7\u30fc\u30bf\u3068\u4e00\u81f4\u3057\u305f\u6642\u306b\u7d42\u4e86\u3057\u307e\u3059\u3002\uff11\u56de\u6bd4\u8f03\u3092\u884c\u3046\u3054\u3068\u306b\u63a2\u7d22\u306e\u7bc4\u56f2\u304c\u534a\u5206\u306b\u306a\u308b\u306e\u3067\u8a08\u7b97\u91cf\u306fO(log n)\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u4ed6\u306b\u3082\u4ee3\u8868\u7684\u306a\u30bd\u30fc\u30c8\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3068\u51e6\u7406\u901f\u5ea6\u306e\u7279\u5fb4\u306e\u6bd4\u8f03\u306fTECHSCORE BLOG\u306e\u3053\u3061\u3089\u306e\u8a18\u4e8b\u306b\u307e\u3068\u3081\u3089\u308c\u3066\u3044\u307e\u3059\u3002<br \/>\n<a href=\"http:\/\/www.techscore.com\/blog\/2014\/12\/06\/comparison-of-sorting-algorithm\/\" target=\"_blank\">\u53c2\u8003\uff1aTECHSCOREBLOG\u300c50\u4ee5\u4e0b\u633f\u5165\u30bd\u30fc\u30c8\u30015\u4e07\u4ee5\u4e0b\u30de\u30fc\u30b8\u30bd\u30fc\u30c8\u3001\u3042\u3068\u306f\u30af\u30a4\u30c3\u30af\u30bd\u30fc\u30c8\u300d<\/a><\/p>\n<h2>\u306a\u305c\u8a08\u7b97\u91cf\u3092\u8003\u3048\u308b\u5fc5\u8981\u304c\u3042\u308b\u306e\u304b<\/h2>\n<p>\u7c21\u5358\u306a\u64ec\u4f3c\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f8b\u306b\u8003\u3048\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br \/>\n\u5909\u6570word\u306b\u4ee3\u5165\u3057\u305f\u5358\u8a9e\u306e\u6587\u5b57\u6570\uff08\u4eca\u56de\u306fHello!\u306a\u306e\u30676\u6587\u5b57\uff09\u3068\u914d\u5217\u306e\u6570\u3092\u6bd4\u8f03\u3057\u3001\u5909\u6570word\u306b\u4ee3\u5165\u3055\u308c\u305f\u6587\u5b57\u6570\u304c\u914d\u5217\u306e\u8981\u7d20\u3068\u7b49\u3057\u3044\u304b\u5927\u304d\u304b\u3063\u305f\u5834\u5408\u306b\u3001Hello!\u3068\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"\">array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\r\nword = \"Hello!\"\r\nfor (i = 0; i &lt; array.length(); i++) {\r\n    if( array[i] &lt;= word.length()) {\r\n        print(word)\r\n    }\r\n}\r\n<\/pre>\n<p>\u3053\u306e\u51e6\u7406\u306b\u304b\u304b\u308b\u6642\u9593\u306f\u3001for\u6587\u306e\u4e2d\u3067\u90fd\u5ea6word.length\u3092\u6c42\u3081\u308b\u51e6\u7406\u3092O(n)\u3001\u305d\u306e\u5f8c\u6587\u5b57\u5217\u306e\u6570\u3068\u914d\u5217\u306e\u6570\u5b57\u3092\u8abf\u3079\u6bd4\u8f03\u3092\u3059\u308b\u51e6\u7406\u3092O(n)\u3067\u884c\u3046\u305f\u3081\u3001n*n=n^2\uff08\u3064\u307e\u308a\u639b\u3051\u7b97\uff09\u306e\u6642\u9593\u304c\u304b\u304b\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002\u3057\u304b\u3057\u3001\u3053\u306e\u6642\u306b\u884c\u3046words.length\u306e\u51e6\u7406\u306f\u6587\u5b57\u6570\u304c\u4e00\u5b9a\u306a\u306e\u3067\u4f55\u56de\u30eb\u30fc\u30d7\u3057\u3066\u3082\u5909\u308f\u308b\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u305d\u3053\u3067\u3001for\u6587\u4e2d\u3067\u306e\u8ca0\u8377\u3092\u6e1b\u3089\u3059\u3088\u3046\u306b\u5909\u6570\u306b\u4ee3\u5165\u3057\u3001\u30eb\u30fc\u30d7\u306e\u5916\u306b\u51fa\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"\">array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\r\nword = \"Hello\"\r\nwordLength = word.length()\r\narrayLength = array.length()\r\nfor (i = 0; i &lt; arrayLemgth; i++) {\r\n    if(array[i] &lt;= wordLength) {\r\n        print(word)\r\n    }\r\n}\r\n<\/pre>\n<p>\u3042\u3089\u304b\u3058\u3081\u3001\u6587\u5b57\u5217\u306e\u6570\u3092wordLength\u3068\u3057\u3066\u51e6\u7406\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u305d\u306e\u90fd\u5ea6\u51e6\u7406\u3059\u308b\u5fc5\u8981\u304c\u306a\u304f\u306a\u308a\u307e\u3057\u305f\u3002\u3053\u308c\u306b\u3088\u3063\u3066for\u6587\u4e2d\u306e\u6bd4\u8f03\u306f\u3001\u305d\u308c\u305e\u308c\u306e\u5024\u3092\u8aad\u307f\u306b\u3044\u3051\u3070\u3088\u3044\u306e\u3067\u3001word\u306e\u6587\u5b57\u6570\u3092\u8abf\u3079\u5909\u6570\u306b\u3044\u308c\u308bO(n)\u3001for\u6587\u4e2d\u3067\u6bd4\u8f03\u304c\u884c\u308f\u308c\u308bO(n)\u3092\u8db3\u3057\u3042\u308f\u305b\u3066\u3001\u8a08\u7b97\u91cf\u306fn+n=2n\uff08\u3064\u307e\u308a\u8db3\u3057\u7b97\uff09\u3068\u306a\u308a\u3001\u3088\u308a\u5c0f\u3055\u304f\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\n\u6700\u7d42\u7684\u306a\u51fa\u529b\u306f\u540c\u3058\u3067\u3042\u3063\u3066\u3082\u3001\u305d\u306e\u7d50\u679c\u3092\u3069\u306e\u3088\u3046\u306a\u624b\u9806\u3067\u6c42\u3081\u308b\u306e\u304b\u306b\u914d\u616e\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u304f\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u306d\u3002\uff08\u203b\u672c\u6587\u3092\u4e00\u90e8\u8a02\u6b63\u3057\u307e\u3057\u305f\u30022016\u5e7410\u670817\u65e5\uff09<\/p>\n<h2>\u304a\u308f\u308a\u306b<\/h2>\n<p>\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306f\u4ee3\u8868\u7684\u306a\u30bd\u30fc\u30c8\u3084\u63a2\u7d22\u306b\u4f7f\u308f\u308c\u3066\u3044\u308b\u3082\u306e\u3060\u3051\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u666e\u6bb5\u79c1\u305f\u3061\u304c\u66f8\u3044\u3066\u3044\u308b\u30b3\u30fc\u30c9\u3082\u624b\u9806\u3092\u660e\u78ba\u306b\u793a\u3057\u3066\u3044\u308b\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306e\u4e00\u7a2e\u3067\u3059\u3002<br \/>\n\u305d\u3053\u3067\u3001\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306e\u51e6\u7406\u306e\u9806\u756a\u3092\u8003\u3048\u3001\u8a08\u7b97\u91cf\u3092\u610f\u8b58\u3059\u308b\u3053\u3068\u3067\u3001\u8ca0\u8377\u306e\u5c11\u306a\u3044\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u66f8\u3051\u308b\u3053\u3068\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002<br \/>\n\u52d5\u304f\u3060\u3051\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u306f\u306a\u304f\u3001\u3088\u308a\u30b9\u30de\u30fc\u30c8\u306a\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u6c17\u3065\u304d\u306b\u306a\u308c\u3070\u5e78\u3044\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3002\u4e00\u677e\u3067\u3059\u3002<br \/>\n\u524d\u56de\u306eSQL\u306e\u57fa\u672c\u306b\u7d9a\u304d\u3001\u4eca\u56de\u306f\u57fa\u672c\u3068\u3057\u3066\u8eab\u306b\u4ed8\u3051\u3066\u304a\u304d\u305f\u3044\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306b\u3064\u3044\u3066\u66f8\u304d\u307e\u3059\u3002<br \/>\n\u306f\u3058\u3081\u306e\u4e00\u6b69\u3068\u3057\u3066\u3001\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3092\u77e5\u308b\u4e0a\u3067\u5fc5\u8981\u306a\u8a08\u7b97\u91cf\u3068\u3044\u3046\u8003\u3048\u65b9\u3068\u4ee3\u8868\u7684\u306a\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306e\u7279\u5fb4\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<br \/><a href=\"https:\/\/www.techscore.com\/blog\/2016\/08\/08\/%e9%96%8b%e7%99%ba%e6%96%b0%e5%8d%92%e3%81%ab%e6%8d%a7%e3%81%90%e3%80%81%e5%9f%ba%e6%9c%ac%e3%81%ae%e3%82%a2%e3%83%ab%e3%82%b4%e3%83%aa%e3%82%ba%e3%83%a0%e3%81%a8%e8%a8%88%e7%ae%97%e9%87%8f\/\">\u7d9a\u304d\u3092\u8aad\u3080...<\/a><\/p>\n","protected":false},"author":57,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[18],"tags":[142],"_links":{"self":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/11191"}],"collection":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/users\/57"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/comments?post=11191"}],"version-history":[{"count":52,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/11191\/revisions"}],"predecessor-version":[{"id":12353,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/11191\/revisions\/12353"}],"wp:attachment":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/media?parent=11191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/categories?post=11191"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/tags?post=11191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}