Mercurial > Algorithms__Sedgewick
comparison algs4-c++/src/ResizingArrayStack.hpp @ 3:ca59e5f5b29e
Initial, imcomplete, C++ version of ResizingArrayStack.
author | Eris Caffee <discordia@eldalin.com> |
---|---|
date | Tue, 26 May 2015 18:18:16 -0500 |
parents | |
children | 310618f5e32a |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:71dfb2228a75 |
---|---|
1 #ifndef RESIZINGARRAYSTACK_HPP | |
2 #define RESIZINGARRAYSTACK_HPP | |
3 | |
4 #include <cstddef> | |
5 | |
6 template <typename T> | |
7 class ResizingArrayStack { | |
8 | |
9 public: | |
10 | |
11 ResizingArrayStack( void ); | |
12 ~ResizingArrayStack( void ); | |
13 | |
14 void push( T &item ); | |
15 T pop( void ); | |
16 | |
17 bool is_empty( void ); | |
18 size_t size( void ); | |
19 | |
20 // class iterator; | |
21 // friend class iterator; | |
22 // class iterator { | |
23 // }; | |
24 | |
25 private: | |
26 | |
27 size_t N; | |
28 size_t max; | |
29 T *data; | |
30 | |
31 void resize( size_t new_max ); | |
32 }; | |
33 | |
34 | |
35 | |
36 #endif | |
37 |