ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/ccscs20/DoublyLinkedList.hpp
(Generate patch)

Comparing DoublyLinkedList.hpp (file contents):
Revision 1 by Douglas Thrift, 2004-05-12T23:36:53-07:00 vs.
Revision 4 by Douglas Thrift, 2004-05-13T17:50:29-07:00

# Line 14 | Line 14 | template<typename Type>
14   class DoublyLinkedList
15   {
16   private:
17 <        NullNode<Type>* front;
18 <        NullNode<Type>* back;
17 >        NullNode<Type> front;
18 >        NullNode<Type> back;
19   public:
20 <        DoublyLinkedList() {}
21 <        ~DoublyLinkedList() {}
22 <        void addFront(Type& type);
23 <        void addBack(Type& type);
20 >        DoublyLinkedList() { front.setNext(&back); back.setPrevious(&front); }
21 >        ~DoublyLinkedList();
22 >        void addFront(const Type& value) { front.addNext(value); }
23 >        void addBack(const Type& value) { back.addPrevious(value); }
24 >        bool contains(const Type& value) { return front.contains(value, &back); }
25   };
26  
27 + template<typename Type>
28 + DoublyLinkedList<Type>::~DoublyLinkedList()
29 + {
30 +        while (front.getNext() != &back) front.removeNext();
31 + }
32 +
33   #endif // _DoublyLinkedList_hpp_

Comparing DoublyLinkedList.hpp (property svn:eol-style):
Revision 1 by Douglas Thrift, 2004-05-12T23:36:53-07:00 vs.
Revision 4 by Douglas Thrift, 2004-05-13T17:50:29-07:00

# Line 0 | Line 1
1 + native

Comparing DoublyLinkedList.hpp (property svn:keywords):
Revision 1 by Douglas Thrift, 2004-05-12T23:36:53-07:00 vs.
Revision 4 by Douglas Thrift, 2004-05-13T17:50:29-07:00

# Line 0 | Line 1
1 + Id

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines