0. Python ã§ãªã¹ãã®è¦ç´ ã swap ããæ¹æ³ Python ã§ããªã¹ãã®ç¹å®ã®ã¤ã³ããã¯ã¹ i, j ã®è¦ç´ ã swap ããããå ´åã以ä¸ã®ããã«æ¸ããã def swap(i, j, ary): tmp = ary[i] ary[i] = ary[j] ary[j] = tmp è¦ç´ ã交æããããã«ãä¸æçã«å¤ãéé¿ããã¦ããå¤æ° tmp ãå©ç¨ããè¦ç´ ãä¸æ¸ãã å¤é代å
¥ã使ããªããä¸æå¤æ°ãçç¥ã§ããã ary[i], ary[j] = ary[j], ary[i] ãããã£ãæä½ãã§ããã®ã¯ãPython ã§ã¯ãªã¹ãããå¤æ´å¯è½ãªã·ã¼ã±ã³ã¹åãã¨ãã¦å®ç¾©ããã¦ããããã ã§ã¯ãåæ§ã®ãã¨ãå¤æ°ã®æ´æ°ãã§ããªã Haskell ã§ã¯ã©ã®ããã«æ¸ãã°ããã®ãï¼ 1. ãã¼ã¿ã³ã³ã¹ãã©ã¯ã¿ã«ããå解㨠take, drop é¢æ°ã使ã ä¾ãã°ãå
·ä½çã« 0 ï½ 7 ãè¦ç´ ã«
{{#tags}}- {{label}}
{{/tags}}