正在加载图片...
More com plete listADT List(i / const List(const List& list)i copy constructor List( destructor ist& operator=(const List& list)i // assignment operator // plus other overloaded operators void add (double x)i double head(consti // get the head element bool search(double x search for a given x void insert(double x) / insert x in a sorted list void delete(double x / delete x in a sorted list void addEnd (double x)i add to the end d deleteD(; delete the end and get the end element double end( / get the element at the end void display ()consti //output it length()consti / count the number of elements2 struct Node{ double data; Node* next; }; class List { public: List(); // constructor List(const List& list); // copy constructor ~List(); // destructor List& operator=(const List& list); // assignment operator // plus other overloaded operators bool empty() const; // boolean function void add(double x); // add to the head void delete(); // delete the head and get the head element double head() const; // get the head element bool search(double x); // search for a given x void insert(double x); // insert x in a sorted list void delete(double x); // delete x in a sorted list void addEnd(double x); // add to the end void deleteEnd(); // delete the end and get the end element double end(); // get the element at the end void display() const; // output int length() const; // count the number of elements private: Node* head; }; More complete list ADT
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有