Commit 1839673
authored
Rollup merge of rust-lang#121262 - 20jasper:add-vector-time-complexity, r=cuviper
Add vector time complexity
Added time complexity for `Vec` methods `push`, `push_within_capacity`, `pop`, and `insert`.
<details>
<summary> Reference images </summary>




</details>
I followed a convention to use `#Time complexity` that I found in [the `BinaryHeap` documentation](https://doc.rust-lang.org/std/collections/struct.BinaryHeap.html#time-complexity-1). Looking through the rest of standard library collections, there is not a consistent way to handle this.
[`Vec::swap_remove`](https://doc.rust-lang.org/std/vec/struct.Vec.html#method.swap_remove) does not have a dedicated section for time complexity but does list it.
[`VecDeque::rotate_left`](https://doc.rust-lang.org/std/collections/struct.VecDeque.html#complexity) uses a `#complexity` heading.1 file changed
+21
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1524 | 1524 | | |
1525 | 1525 | | |
1526 | 1526 | | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
1527 | 1533 | | |
1528 | 1534 | | |
1529 | 1535 | | |
| |||
1947 | 1953 | | |
1948 | 1954 | | |
1949 | 1955 | | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
1950 | 1963 | | |
1951 | 1964 | | |
1952 | 1965 | | |
| |||
1995 | 2008 | | |
1996 | 2009 | | |
1997 | 2010 | | |
| 2011 | + | |
| 2012 | + | |
| 2013 | + | |
| 2014 | + | |
1998 | 2015 | | |
1999 | 2016 | | |
2000 | 2017 | | |
| |||
2024 | 2041 | | |
2025 | 2042 | | |
2026 | 2043 | | |
| 2044 | + | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + | |
2027 | 2048 | | |
2028 | 2049 | | |
2029 | 2050 | | |
| |||
0 commit comments