常數時間
在計算複雜度理論中,常數時間是一種時間複雜度,它表示某個演算法求出解答的時間在固定範圍內,而不依照問題輸入資料大小變化。
常數時間記為(採用大O符號)。數字1可以替換為任意常數。
舉例:
- 想在「存取陣列上的元素」的問題上達到常數時間,只要以元素的序位存取即可。
- 然而「在陣列上搜尋最小值」並不是一個常數時間問題,因為這需要掃描陣列上的每一個元素以尋找最小值及其位置,一般需要次訪問。
參考文獻
書籍
- Arora, Sanjeev; Barak, Boaz, Computational Complexity: A Modern Approach, Cambridge, 2009 [2018-01-19], ISBN 978-0-521-42426-4, Zbl 1193.68112, (原始內容存檔於2021-03-20)
- Downey, Rod; Fellows, Michael, Parameterized complexity, Berlin, New York: Springer-Verlag, 1999
- Du, Ding-Zhu; Ko, Ker-I, Theory of Computational Complexity, John Wiley & Sons, 2000, ISBN 978-0-471-34506-0
- Template:Garey-Johnson
- Goldreich, Oded, Computational Complexity: A Conceptual Perspective, Cambridge University Press, 2008 [2018-01-19], (原始內容存檔於2021-11-08)
- van Leeuwen, Jan (編), Handbook of theoretical computer science (vol. A): algorithms and complexity, MIT Press, 1990, ISBN 978-0-444-88071-0
- Papadimitriou, Christos, Computational Complexity 1st, Addison Wesley, 1994, ISBN 0-201-53082-1
- Sipser, Michael, Introduction to the Theory of Computation 2nd, USA: Thomson Course Technology, 2006, ISBN 0-534-95097-3
研究報告
- Khalil, Hatem; Ulery, Dana, A Review of Current Studies on Complexity of Algorithms for Partial Differential Equations, Proceedings of the annual conference on - ACM 76 (ACM '76 Proceedings of the 1976 Annual Conference), 1976: 197, doi:10.1145/800191.805573
- Cook, Stephen, An overview of computational complexity (PDF), Commun. ACM (ACM), 1983, 26 (6): 400–408 [2018-01-19], ISSN 0001-0782, doi:10.1145/358141.358144, (原始內容 (PDF)存檔於2018-07-22)
- Fortnow, Lance; Homer, Steven, A Short History of Computational Complexity (PDF), Bulletin of the EATCS, 2003, 80: 95–133 [2018-01-19], (原始內容存檔 (PDF)於2021-03-20)
- Mertens, Stephan, Computational Complexity for Physicists, Computing in Science and Eng. (Piscataway, NJ, USA: IEEE Educational Activities Department), 2002, 4 (3): 31–47, ISSN 1521-9615, arXiv:cond-mat/0012185 , doi:10.1109/5992.998639