From 6b7c651717745e827d644063bdb8cca58acf71ac Mon Sep 17 00:00:00 2001 From: Mohit Arora <32641304+mohitarora3@users.noreply.github.com> Date: Sat, 3 Oct 2020 13:36:48 +0000 Subject: [PATCH] Update stack_using_list.cpp --- stack_using_list.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/stack_using_list.cpp b/stack_using_list.cpp index 1e777b1..dbabcd0 100644 --- a/stack_using_list.cpp +++ b/stack_using_list.cpp @@ -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