Skip to content

Vector

Brief explanation.

Operations & time complexity

Methods RunningTime
push_back(val) O(1)
pop() O(1)
empty() O(1)

:point_right:you can use table generator

Implementation

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#include <cstido>
#include <iostream>

template<typename T>
class Vector { //use TitleCase for DataStructure implementation
    ---snip---
}

int main() {
    //few lines of code to test your implementation
    Vector<int> v;
    for (int i = 0; i < n; i++) {
        v.push_back(rand()%100);
    }
    sort(v.begin(), v.end())
        for (auto x: v) {
            cout << x << ' ';
        }
}

:point_right: keep your implementation self-contained.

  1. title of easy problem :star: :link:
  2. Some hard problem :star::star::star::star: :link:
  3. Lily want a phone :star::star::star::star::star: :link:

:point_right: add difficulty information(optional)

Stack

Analysis (Optional)

You can add some mathematical things here using KaTex

as a block tag $$ T(N) = O(N*M) $$

or as a inline tag $T(N) = O(N) $

Contributers (Optional)

07.12.2019 :tada: contributer1
07.14.2019 :pencil2: typo correction contributer2
07.15.2019 :sparkles: add new section "Analysis" contributer3
07.18.2019 :bug: fix bugs in "implementation" contributer4
07.19.2019 :zap: improved performance "implementation" contributer5
07.23.2019 :recycle: refactoring "implementation" contributer6
08.02.2019 :heavy_plus_sign: add related problems contributer7

Comments