Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions stack_using_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,21 @@ class SLinkedList {
output value: none
side effects: Class SlinkedList defines Single Linked LIst class
approach: Class definition
*/
public:
SLinkedList(); // empty list constructor
~SLinkedList(); // destructor
bool empty() ; // is list empty?
string front(); // get front element
void addFront(string e); // add to front of list
void addBack(string e); // add to back of list
void removeFront(); // remove from front
void removeEnd(); // remove from end
void print(); // prints the SLL
*/
private:
SNode* head; // pointer to the head of list
SNode* head;
public:

SLinkedList(); // empty list constructor
~SLinkedList(); // destructor
bool empty() ; // is list empty?
string front(); // get front element
void addFront(string e); // add to front of list
void addBack(string e); // add to back of list
void removeFront(); // remove from front
void removeEnd(); // remove from end
void print(); // prints the SLL
// pointer to the head of list
};

class stack
Expand Down