Add RD for vector class using templates

This commit is contained in:
2020-07-24 16:55:36 -04:00
parent 2c6400cc87
commit c31a7a6571
3 changed files with 36 additions and 31 deletions

View File

@@ -1,7 +1,7 @@
/*#############################################################################
## Author: Shaun Reed ##
## Legal: All Content (c) 2020 Shaun Reed, all rights reserved ##
## About: An example of a vector implementation ##
## About: An example of a vector implementation using templates ##
## ##
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
##############################################################################
@@ -28,21 +28,21 @@ class Vector {
bool isEmpty() const;
bool isFull() const;
void print() const;
T getMax() const;
T getSize() const;
T getIndex() const;
T getValue(T index) const;
int getMax() const;
int getSize() const;
int getIndex() const;
T getValue(int index) const;
private:
T maxSize;
T curIndex;
int maxSize;
int curIndex;
T *data;
bool push(T val, T *&data);
T pop(T *&data);
void makeEmpty(T *&data);
T peek(T *data) const;
void print(T *data) const;
};
#endif