æ¬ã³ã³ãã³ãã®ä¸é¨ã¯ãæ¥åæéå ã«èª¿ã¹ãå 容ãå«ãã§ãããæ ªå¼ä¼ç¤¾ãã£ã¼ã»ã¨ãã»ã¨ã¼ã®æä¾ã§ãéããã¦ããã¾ãã ããã¤ãã®å¾ªç°æ¤åºæ³ ããã¤ãã®å¾ªç°æ¤åºæ³ãå¿ è¦ã«ãªã£ãããJSã§å®è£ ã 詳細ã¯wikipediaã¨ãè¦ããããã /* Floyd's cycle-finding algorithm http://www.pierreq.kylos.pl/public/cycledetection.pdf */ function floyd(top) { var tortoise = top; var hare = top; while(true) { if(!hare.slice(1) || hare.length === 0) { return false; } hare = hare.slice(1); if(!hare.slice(1) || hare.length === 0) {
{{#tags}}- {{label}}
{{/tags}}