ããæ¶é´å¤æ度 åä¸é®é¢å¯ç¨ä¸åç®æ³è§£å³ï¼èä¸ä¸ªç®æ³çè´¨éä¼å£å°å½±åå°ç®æ³ä¹è³ç¨åºçæçãç®æ³åæçç®çå¨äºéæ©åéç®æ³åæ¹è¿ç®æ³ã
ãã计ç®æºç§å¦ä¸ï¼ç®æ³çæ¶é´å¤æ度æ¯ä¸ä¸ªå½æ°ï¼å®å®éæè¿°äºè¯¥ç®æ³çè¿è¡æ¶é´ãè¿æ¯ä¸ä¸ªå ³äºä»£è¡¨ç®æ³è¾å ¥å¼çå符串çé¿åº¦çå½æ°ãæ¶é´å¤æ度常ç¨å¤§O符å·è¡¨è¿°ï¼ä¸å æ¬è¿ä¸ªå½æ°çä½é¶é¡¹åé¦é¡¹ç³»æ°ã使ç¨è¿ç§æ¹å¼æ¶ï¼æ¶é´å¤æ度å¯è¢«ç§°ä¸ºæ¯æ¸è¿çï¼å®èå¯å½è¾å ¥å¼å¤§å°è¶è¿æ ç©·æ¶çæ åµã
ãã空é´å¤æ度(Space Complexity)æ¯å¯¹ä¸ä¸ªç®æ³å¨è¿è¡è¿ç¨ä¸ä¸´æ¶å ç¨åå¨ç©ºé´å¤§å°çé度ï¼è®°åS(n)=O(f(n))ãæ¯å¦ç´æ¥æå ¥æåºçæ¶é´å¤æ度æ¯O(n^2),空é´å¤æ度æ¯O(1) ãèä¸è¬çéå½ç®æ³å°±è¦æO(n)ç空é´å¤æ度äºï¼å 为æ¯æ¬¡éå½é½è¦åå¨è¿åä¿¡æ¯ãä¸ä¸ªç®æ³çä¼å£ä¸»è¦ä»ç®æ³çæ§è¡æ¶é´åæéè¦å ç¨çåå¨ç©ºé´ä¸¤ä¸ªæ¹é¢è¡¡éã