ç´¯ä¹(x^n)ãåç´ã«è¨ç®ããã¨ããªã¼ãã¼ã¯ O(n)ã¨ãªãå¹çãæªãã§ããããã§ãnã2ã®ç´¯ä¹ã«å解ãã¦è¨ç®ããé«éåææ³ãä¸è¬ã«ç¥ããã¦ãã¾ãã ãã¨ãã°ã3 ã® 11 ä¹ãè¨ç®ããå ´åãèãã¾ãããã11 㯠1 + 2 + 8 ã«å解ã§ãã¾ãã ãã®ç´¯ä¹ã®ç³»åã§ã¯ãããå¤ã¯ä¸ã¤åã®å¤ã2ä¹ãããã¨ã§è¨ç®ã§ãã¾ãããã¨ãã°ãããã§ãã 3^1 = 3 3^2 = 3 * 3 = 9 3^4 = (3^2)^2 = 9^2 = 81 3^8 = (3^4)^2 = 81^2 = 6561ãã£ã¦ã3^11 ã¯ä»¥ä¸ã®ããã«è¨ç®ã§ãã¾ãã 3^11 = 3^(1+2+8) = 3^1 à 3^2 à 3^8 = 3 à 9 à 6561 = 177147ãã®æ¹æ³ã®ãªã¼ãã¼ã¯ãO(log2(n)) ã§ãã é 延è©ä¾¡é¢¨ã« RSA ã®ããã«é«éãªç´¯ä¹è¨ç®ã Haskell ã§å®è£ ãããã¨ãããã¾ã
{{#tags}}- {{label}}
{{/tags}}