Created
May 13, 2022 17:17
-
-
Save zhhailon/ec62d115bb1cb5b0c299ac489821ac2e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** List abstract class. */ | |
template <typename ItemType> class List { | |
public: | |
virtual int size() const = 0; | |
virtual ItemType &get(int i) = 0; | |
virtual const ItemType &get(int i) const = 0; | |
virtual void insert(const ItemType &x, int i) = 0; | |
virtual ItemType remove(int i) = 0; | |
virtual void addFirst(const ItemType &x) = 0; | |
virtual void addLast(const ItemType &x) = 0; | |
virtual ItemType &getFirst() = 0; | |
virtual ItemType &getLast() = 0; | |
virtual const ItemType &getFirst() const = 0; | |
virtual const ItemType &getLast() const = 0; | |
virtual ItemType removeFirst() = 0; | |
virtual ItemType removeLast() = 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment