ã¯ããã« ãã®è¨äºã§ã¯ãããã°ã©ã ã®è¨ç®éãæ±ããæ¹æ³ã説æãã¾ããããã°ã©ãã³ã°ã®åå¿è åãã«ãå³å¯ããããåããããããåªå ãã¦èª¬æãã¦ããã¾ãã ãµã³ãã«ã³ã¼ãã«ã¤ã㦠ãã®è¨äºã®ãµã³ãã«ã³ã¼ãã¯ãCè¨èªï¼C99ï¼ã§è¨è¿°ãã¦ãã¾ãã è¨ç®éã¨ã¯ï¼ è¨ç®éã¨ã¯ã ããã®ããã°ã©ã ãã©ããããéããã大éæã«è¡¨ãææ¨ã ã§ãã ããå°ãæ£ç¢ºã«è¨ãã¨ã ãå ¥åãµã¤ãºã®å¢å ã«å¯¾ãã¦ãå®è¡æéãã©ããããã®å²åã§å¢å ãããã表ãææ¨ã ã§ãã ã°ã©ãã«ããè¨ç®éã®è¡¨ç¾ è¨ç®éãã°ã©ãã§è¡¨ãã¨ã以ä¸ã®ããã«ãªãã¾ãã ããã¯ã**ãå ¥åãµã¤ãº $n$ ãå¢å ããã«ã¤ãã¦ãå®è¡æéã $n$ ã«æ¯ä¾ãã¦å¢å ããã**ã¨ãããã¨ã表ãã¦ãã¾ãã å¥ã®ã°ã©ããè¦ã¦ã¿ã¾ãããã ããã¯ã**ãå ¥åãµã¤ãº $n$ ãå¢å ããã«ã¤ãã¦ãå®è¡æéã $n^2$ ã«æ¯ä¾ãã¦å¢å ããã**ã¨ãããã¨ã表ãã¦ãã¾ã
Pythonã§ããã°ã©ã ãæ¸ãã¨ããã»ã¼å¿ é ã¨ãªããã¼ã¿æ§é ã§ãããªã¹ã (list) ã®ä»çµã¿ãç´¹ä»ãã¾ããåèªèº«Pythonããã使ãã®ã§ãããããã¾ã§å®è£ ãæèãã¦ããªãã£ãã®ã§ãå é¨ã®ä»çµã¿ã«ã¤ãã¦ã¾ã¨ãã¦ã¿ã¾ãããPythonã®ãªã¹ãã¯è¦ç´ ã®è¿½å (list.append) /åé¤ (list.pop) ã«ããããµã¤ãºãåçã«å¤æ´ããã¾ããããããã¯O(1)ã§é«éã«è¡ã (list.popã¯æ«å°¾è¦ç´ ã®ã¿) ãã¨ãã§ãã¾ãããã®è¨äºã§ã¯ãã®çç±ã«ã¤ãã¦è§£èª¬ãã¦ããã¾ãã Pythonã®ãªã¹ãã®ãããªç¹å¾´ãæã£ããã¼ã¿æ§é ã¯åçé å (dynamic array) ã¨å¼ã°ãã¾ããé常ã®é åã¯éçé å (static array)ã¨ãã¦åºå¥ããã¾ãã ãã®è¨äºã§ã¯ãåçé åã®æ¦è¦ãè¦ç´ ã®è¿½å /åé¤ã«ã¤ãã¦ãMITã®è¬ç¾© (Table Doubling, Karp-Rabin) ãå ã«ä»¥
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}