max é¢æ°ã min é¢æ°ã¯ C è¨èªã ã¨èªåã§æ¸ããªãã¨ãããªãã®ã§ int max(int a, int b) { return a>b?a:b; } ãªã©ã¨æ¸ãããããã®ã ãï¼æ¯è¼ãè¡ã£ã¦ããã®ã§åå²ãçºçããããé ããªãã¨æãï¼ããã£ã¦æ¬å½ã«éãã®ãã¨æã£ã¦èª¿ã¹ã¦ã¿ãï¼ å®é¨ 以ä¸ã®ï¼ã¤ã®ã³ã¼ããç¨æããï¼ãããããããã max é¢æ°ã®å®è£ ã¨ããï¼æ¤è¨¼ç¨ã®ã³ã¼ãã¯æå¾ã«è¼ããï¼PHP ã§ã©ã³ãã ãªï¼æ°å¤ãä½ã£ããã¼ã¿ã 1,000,000 çµç¨æãï¼å ¥åãã¼ã¿ã¨ãã¦é åã«èªã¿è¾¼ãã ãã¨ï¼ã«ã¼ã㧠max é¢æ°ãå®è¡ããï¼ãã®ã«ã¼ãã®åå¾ã§ gettimeofday ã§æéã測ãï¼æè¦æéãç®åºããï¼ããããã®å®è£ ã«å¯¾ãæè¦æéã®ï¼åã®å¹³åãã¨ã£ã¦æ¯è¼ããï¼ã³ã¼ã㯠gcc version 4.2.1 (Apple Inc. build 5664) ã§ãªãã·ã§ã³ç¡ãã§ã³ã³ãã¤ã«ã
{{#tags}}- {{label}}
{{/tags}}