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 7:4ed66162aaa8, committed 2014-02-23
- Comitter:
- Sissors
- Date:
- Sun Feb 23 14:09:48 2014 +0000
- Parent:
- 6:e3ab7684c395
- Child:
- 8:918b196b0ac4
- Commit message:
- Removed LogUtil dependency
Changed in this revision
LinkedList.cpp | Show annotated file Show diff for this revision Revisions of this file |
LinkedList.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/LinkedList.cpp Tue May 14 23:06:11 2013 +0000 +++ b/LinkedList.cpp Sun Feb 23 14:09:48 2014 +0000 @@ -21,7 +21,6 @@ */ #include "LinkedList.h" // api wrapper -#include "LogUtil.h" template<class retT> LinkedList<retT>::LinkedList() @@ -48,7 +47,7 @@ // make sure the new object was allocated if (0 == new_node) { - ERROR("Memory allocation failed\n"); + error("Memory allocation failed\n"); } // update the next item in the list to the current head new_node->next = _head; @@ -66,7 +65,7 @@ // // make sure the new object was allocated // if (0 == new_node) // { -// ERROR("Memory allocation failed\n"); +// error("Memory allocation failed\n"); // } // retT *current = _head->next; // retT *prev = _head; @@ -97,7 +96,7 @@ // make sure the new object was allocated if (0 == new_node) { - ERROR("Memory allocation failed\n"); + error("Memory allocation failed\n"); } // store the address to the linked datatype new_node->data = data;
--- a/LinkedList.h Tue May 14 23:06:11 2013 +0000 +++ b/LinkedList.h Sun Feb 23 14:09:48 2014 +0000 @@ -24,6 +24,7 @@ #define LINKEDLIST_H_ #include <stdint.h> +#include "mbed.h" /** * @struct node