algorithm
ä»å¹´ãååãçµãããã¨ãã¦ããã1æã® TODO ã解決ããã 404 Blog Not Found:Algorithm - Suffix Array ã JavaScript ã§åçºæãã¦ã¿ã Suffix Array ã§ã¯ãªã BWT ã®æ¹ãã Groovy ã§å®è£ ãã¦ã¿ã åè http://homepage3.nifty.com/DO/blocksorting.htmâ¦
ã²ã¼ã ãã¯ããã使ã£ãã²ã¼ã ããã£ã¦ããã ãã¯ããã« 1 ãã 100 ã¾ã§ã®æ°åãæ¸ã缶ã«å ¥ãã¦ããã 缶ãæ¯ã£ã¦ãã10åã¨ãã ãã¦ä¸¦ã¹ãã 両æã®æã使ã£ã¦ãã¯ãããå ¥ãæ¿ããªããæ°åã®é ã«ä¸¦ã¹ãã ä¸å¿ç«¶äºãªãã ãã©ä¸æã«ãã£ãããã¦ããããâ¦
æååç §åã®ã¢ã«ã´ãªãºã ã¯ç解ãã¦ãçµæ㯠java.lang.String#indexOf ã¨å¤ãããªãã ãã String#indexOf ã O(NM) ã§ããã®ã«å¯¾ã㦠O(N) ã§å¦çã§ãã*1ã Boyer-Moore algorithm (BMæ³) 㯠KMP æ³ã Z algorithm ã¨åãã O(N) ã ãå¹³åæ¯è¼åæ°ã¯åªâ¦
ç解ã§ããã¨æ¥½ãããã©é£ããã¦ç解ã§ããªããã¨ãå¤ãã ç解ã®ç¨®é¡ã§åé¡ããã¨æ¬¡ã®ããã«ãªãã æ¦è¦ãç解ãã¦ãã (API ã使ãã) ä»çµã¿ãç解ãã¦ãã (å®è£ ã§ãã) æ§ã ãªåé¡ã§ãããé©åã«ä½¿ãã å¤§æµ 1 ã¯ã¾ãä½ã¨ããªãããããããåãã£ã¦ãâ¦
WEB-DB PRESS Vol.66 ã«æååæ¤ç´¢ã®ã¢ã«ã´ãªãºã ãè¼ã£ã¦ããã®ã§ãæ¤ç´¢ãã¦ãããæ°ã¥ããã㨠ä»ã¾ã§ Boyer-Moore ã ã¨æã£ã¦ãããã®ã¯ Boyer-Moore-Horspool ã ã£ã KMP æ³ã®ããã°ã©ã ã¯ã·ã³ãã«ãªã®ã«èªããªã KMP æ³ã«ã¤ãã¦ã¯æ¥æ¬èªã§æ¸ãããããâ¦
diffã®åä½åçãç¥ããã©ã®ããã«ãã¦å·®åãå°ãåºãã®ã ãèªãã§ããããã¶ãæéãçµãããã©ã Diff ã®ã¢ã«ã´ãªãºã ãç解ã§ãã*1ã ç解ããããã«ããããæ¤ç´¢ããã Diff algorithm ã®è§£èª¬ãèªåã«ã¯ãã¡ã°ãåãããããã£ã*2ããã®ã¨ã³ããªããªâ¦
Longest common subsequence - Rosetta Code ã Groovy ã§å®è£ ãã¦ã¿ãã DP 㯠Java çãå帰㯠Haskell çãåèã«ããã Dynamic programming def lcs1(xs, ys) { int N = xs.size() int M = ys.size() int[][] dp = new int[N+1][M+1] for (i in 0..
ãããã³ç¬¦å·ã¯ãã¼ã¿å§ç¸®ã®ææ³ã§ ãããã°ã©ãã³ã°ã³ã³ãã¹ããã£ã¬ã³ã¸ããã¯ã ã«ããã¨è²ªæ¬²æ³ã«ãªããããã åºç¾é »åº¦ãé«ãæåã«ããçã符å·ãå²ãå½ã¦ãã®ã§å ã®æååããå§ç¸®ã§ããã ã¨ã³ã³ã¼ãã®æé æååããé »åº¦è¡¨ãä½æãã é »åº¦è¡¨ãããâ¦
Y combinator ã«ã¤ãã¦åãã£ã(æ°ããã)ç¯å²ã®ã¡ã¢ ãScheme æç¿ãã 9ç« ãã®ç« ãé£ããã¦æ©ãã§ããã®ã ãã©çç±ãåãã£ãã Learning Programming Languages with Koans ã«ããã¨*1ãScheme æç¿ãã㯠Koan ã®å ã«ãªã£ã¦ããããã ã åç« ã¯ãããã¼â¦
以åãASTå¤æã§ãã¤ãã³ã¼ããç´æ¥çæãã¦è¨ç®ããæ¹æ³ã§ Pure Java ããéããã¨ã話é¡ã«ä¸ãã£ã¦ããã*1 http://www.jroller.com/melix/entry/yes_fibonacci_in_groovy_can éããGroovy! - uehaj's blog Pure Java ããéãã Groovy! - åãã³'s BLOGâ¦
ã·ã£ããã«é¢é£ã®ã¡ã¢ 1å¹´åã®è¨äº ãMicrosoft ãæä¾ãã¦ãããã©ã¦ã¶é¸æã§ã©ã³ãã ã§ããã¯ãã®è¡¨ç¤ºé åºã«åãããã£ããã¨ããå 容ã ã MSãWebãã©ã¦ã¶é¸æç»é¢ã«ã¢ã«ã´ãªãºã ä¸ã®ãã°ã â ï¼ IT Doing the Microsoft Shuffle: Algorithm Fail in Browsâ¦
ã¾ã㯠Groovy ã®æ©è½ã§ Groovy ã® List ã¯é åãçæããã¡ã½ãããæã£ã¦ããã*1 [1,2,3].permutations().each { println it } ãã ããè¾æ¸å¼é åºã§ã¯ãªãã [1, 2, 3] [2, 3, 1] [3, 2, 1] [3, 1, 2] [2, 1, 3] [1, 3, 2] ã§ã Collection#eachPermutatâ¦