Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: linearArray.h
- Revision:
- 3:8e9f85814809
- Parent:
- 2:92576523c23e
- Child:
- 4:7743528fb9e5
--- a/linearArray.h Wed Oct 05 09:35:55 2016 +0000
+++ b/linearArray.h Wed Mar 01 10:35:15 2017 +0000
@@ -8,18 +8,22 @@
public:
LinearArray(int size);
~LinearArray();
- int add(type item);
- void remove(int index);
+ int push(type item);
+ type pop(int index = 0);
+ type& peek(int index = 0);
int size();
int elements();
bool hasSpace();
- type& operator[](int index);
+ bool empty();
private:
type* array;
int elem_count;
int array_size;
+
+ int elem_decrease();
+ int elem_increase();
};
#include "linearArray.hpp"
-#endif /* LINEAR_ARRAY_H */
\ No newline at end of file
+#endif /* LINEAR_ARRAY_H */