Added ability to maintain ordered linked list based on "insertAsc" function. The function takes a comparator function that allows for specific order behavior. If values collide, then FIFO or LIFO order can be maintained based on comparator function implementation.
Fork of LinkedList by
Revision 4:59b2aa82b517, committed 2013-04-10
- Comitter:
- sam_grove
- Date:
- Wed Apr 10 06:17:21 2013 +0000
- Parent:
- 3:c14e7a918e21
- Child:
- 5:28e11c75b433
- Commit message:
- removed setting _head->next to 0 in the constructor. Was writing to uninitialized (unallocated) memory location
Changed in this revision
LinkedList.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/LinkedList.cpp Mon Apr 08 22:23:25 2013 +0000 +++ b/LinkedList.cpp Wed Apr 10 06:17:21 2013 +0000 @@ -26,9 +26,9 @@ template<class retT> LinkedList<retT>::LinkedList() { - // clear the members + // clear the member _head = 0; - _head->next = 0; +// _head->next = 0; return; }