Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template<class T>
- class List<T> {
- class Node{
- T data;
- Node * next;
- ...
- };
- Node * head;
- ...
- ~List() {/*iterating through all nodes and deleting them*/}
- ...
- };
- template<class T>
- class Tree<T> {
- class Node {
- Node * next;
- ...
- T key;
- List<int> internal_list;
- };
- destroy_node(Node * x) { delete x; }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement