feat(ll)!: add new ll function and rename insert
ds_*ll_insert -> ds_*ll_append to better reflect what it does and there is now ds_*ll_add to add data anywhere in the ll.
This commit is contained in:
parent
46b0219ab4
commit
69dc1dcb45
4 changed files with 104 additions and 16 deletions
|
|
@ -8,8 +8,8 @@ Example of working with a singly linked list (sll):
|
|||
char *a = "one";
|
||||
char *b = "two";
|
||||
ds_sll_t *ll = ds_sll_init();
|
||||
ds_sll_insert(ll, a); // [ "one" ]
|
||||
ds_sll_insert(ll, b); // [ "one", "two" ]
|
||||
ds_sll_append(ll, a); // [ "one" ]
|
||||
ds_sll_append(ll, b); // [ "one", "two" ]
|
||||
ds_ll_foreach(ds_sll_t, ll) {
|
||||
puts(cur->data);
|
||||
// one
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue