Commit 22827fd
authored
Rollup merge of #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 | |
|---|---|---|---|
| |||
1490 | 1490 | | |
1491 | 1491 | | |
1492 | 1492 | | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
1493 | 1499 | | |
1494 | 1500 | | |
1495 | 1501 | | |
| |||
1913 | 1919 | | |
1914 | 1920 | | |
1915 | 1921 | | |
| 1922 | + | |
| 1923 | + | |
| 1924 | + | |
| 1925 | + | |
| 1926 | + | |
| 1927 | + | |
| 1928 | + | |
1916 | 1929 | | |
1917 | 1930 | | |
1918 | 1931 | | |
| |||
1961 | 1974 | | |
1962 | 1975 | | |
1963 | 1976 | | |
| 1977 | + | |
| 1978 | + | |
| 1979 | + | |
| 1980 | + | |
1964 | 1981 | | |
1965 | 1982 | | |
1966 | 1983 | | |
| |||
1990 | 2007 | | |
1991 | 2008 | | |
1992 | 2009 | | |
| 2010 | + | |
| 2011 | + | |
| 2012 | + | |
| 2013 | + | |
1993 | 2014 | | |
1994 | 2015 | | |
1995 | 2016 | | |
| |||
0 commit comments