C Everything
This is a C repository containing a curated set of generic data structures and algorithm.
|
Contains definitions of routines supported by link list. More...
#include "link_list.h"
Go to the source code of this file.
Functions | |
void | add_begin_sll (t_gen d, t_gen data) |
Add Beggining for singly LL More... | |
void | add_begin_dll (t_gen d, t_gen data) |
Add Beggining for doubly LL More... | |
void | add_begin_scll (t_gen d, t_gen data) |
Add Beggining for Singly Circular LL More... | |
void | add_begin_dcll (t_gen d, t_gen data) |
Add Beggining for Doubly Circular LL More... | |
void | add_begin_xor_dll (t_gen d, t_gen data) |
Add begin in xor link list More... | |
void | add_end_sll (t_gen d, t_gen data) |
Add End for Singly LL More... | |
void | add_end_dll (t_gen d, t_gen data) |
Add End for Doublly LL More... | |
void | add_end_scll (t_gen d, t_gen data) |
Add End for Singly Circular LL More... | |
void | add_end_dcll (t_gen d, t_gen data) |
Add End for Doubly Circular LL More... | |
void | add_end_xor_dll (t_gen d, t_gen data) |
add end in xor link list More... | |
t_gen | del_node_sll (t_gen d, t_gen data) |
Delete node with matching data in singly LL and return the instance More... | |
t_gen | del_node_dll (t_gen d, t_gen data) |
Delete node with matching data in Doublly LL and return the instance More... | |
t_gen | del_node_scll (t_gen d, t_gen data) |
Delete node with matching data in Singly Circular LL and return the instance More... | |
t_gen | del_node_dcll (t_gen d, t_gen data) |
Delete node with matching data in Doubly Circular LL and return the instance More... | |
t_gen | del_node_xor_dll (t_gen d, t_gen data) |
Delete node with matching data in xor link list More... | |
t_gen | del_node_sll_idx (t_gen d, int idx) |
Delete node with matching index in singly LL and return the instance More... | |
t_gen | del_node_dll_idx (t_gen d, int idx) |
Delete node with matching index in Doublly LL and return the instance More... | |
t_gen | del_node_scll_idx (t_gen d, int idx) |
Delete node with matching index in Singly Circular LL and return the instance More... | |
t_gen | del_node_dcll_idx (t_gen d, int idx) |
Delete node with matching index in Doubly Circular LL and return the instance More... | |
t_gen | del_node_xor_idx (t_gen d, int idx) |
Delete node with matching index in XOR LL and return the instance More... | |
int | linklist_length (t_gen d) |
Length of the link list More... | |
t_gen | linklist_find (t_gen d, t_gen data) |
Brief description. Find data in the link list. More... | |
t_gen | linklist_getnode (t_gen d, int idx) |
Get the i th node of the link list idx of node should be between 0 and < list count. More... | |
void | linklist_print (t_gen d) |
Print the elems of link list More... | |
void | linklist_print_info (t_gen d) |
Print the elem in linklist with linkinfo More... | |
void | destroy_link_list (t_gen d) |
Destroy instance of the LL More... | |
t_gen | linklist_get_head (t_gen d) |
Get the head node of link list More... | |
t_gen | linklist_get_tail (t_gen d) |
Get the tail node of link list More... | |
t_gen | linklist_get_end (t_gen d) |
Get the end of link list More... | |
t_gen | linklist_get_next (t_gen d, t_gen n) |
Get the next node of given node in link list limitation for xor next node be it iterrates from head meaning first call should pass head node addr and next time next node and so on More... | |
t_gen | linklist_get_prev (t_gen d, t_gen n) |
Get the prev node of given node in link list limitation for xor prev node be it iterrates from tail meaning first call should pass tail node addr and next time the node before tail and so on More... | |
t_gen | linklist_get_node_data (t_gen n) |
Fetch node data; More... | |
t_gen | xor (t_gen x, t_gen y) |
Util fuction to complete xor operation between two pointers returns the xor'ed result as a t_gen type More... | |
t_gen | create_link_list (char *name, e_lltype type, t_dparams *prm) |
Create an instance of link list More... | |
char * | get_lltype_name (e_lltype type) |
Variables | |
f_ins | add [] = {add_begin_sll,add_begin_dll,add_begin_scll,add_begin_dcll, add_begin_xor_dll} |
Look Up function ptrs for add based on type of list. More... | |
f_ins | append [] = {add_end_sll,add_end_dll,add_end_scll,add_end_dcll, add_end_xor_dll} |
Look Up function ptrs for apend (add end) based on type of list. More... | |
f_del | del [] = {del_node_sll, del_node_dll, del_node_scll, del_node_dcll, del_node_xor_dll} |
Look Up function ptrs for delete node based on type of list. More... | |
f_del_idx | del_idx [] = {del_node_sll_idx, del_node_dll_idx, del_node_scll_idx, del_node_dcll_idx, del_node_xor_idx} |
Look Up function ptrs for delete ith node based on type of list. More... | |
Contains definitions of routines supported by link list.
Definition in file link_list.c.
Add Beggining for Doubly Circular LL
d | - Pointer to instance of link list |
data | - Pointer to the data to be added |
Definition at line 211 of file link_list.c.
Add Beggining for doubly LL
d | - Pointer to instance of link list |
data | - Pointer to the data to be added |
Definition at line 149 of file link_list.c.
Add Beggining for Singly Circular LL
d | - Pointer to instance of link list |
data | - Pointer to the data to be added |
Definition at line 181 of file link_list.c.
Add Beggining for singly LL
d | - Pointer to instance of link list |
data | - Pointer to the data to be added |
Definition at line 123 of file link_list.c.
Add begin in xor link list
d | - Pointer to instance of link list |
data | - Pointer to the data to be added |
Definition at line 251 of file link_list.c.
Add End for Doubly Circular LL
d | - Pointer to instance of link list |
data | - Pointer to the data to be added |
Definition at line 370 of file link_list.c.
Add End for Doublly LL
d | - Pointer to instance of link list |
data | - Pointer to the data to be added |
Definition at line 312 of file link_list.c.
Add End for Singly Circular LL
d | - Pointer to instance of link list |
data | - Pointer to the data to be added |
Definition at line 341 of file link_list.c.
Add End for Singly LL
d | - Pointer to instance of link list |
data | - Pointer to the data to be added |
Definition at line 285 of file link_list.c.
add end in xor link list
d | - Pointer to instance of link list |
data | - Pointer to the data to be added |
Definition at line 400 of file link_list.c.
Create an instance of link list
name | - Name of link list instance |
type | - Type of link list to be created |
prm | - Data type specific parameters |
Definition at line 69 of file link_list.c.
Delete node with matching data in Doubly Circular LL and return the instance
d | - Pointer to instance of link list |
data | - Pointer to the data which has to be deleted |
Definition at line 619 of file link_list.c.
Delete node with matching index in Doubly Circular LL and return the instance
d | - Pointer to instance of link list |
idx | - index of the node to be deleted |
Definition at line 947 of file link_list.c.
Delete node with matching data in Doublly LL and return the instance
d | - Pointer to instance of link list |
data | - Pointer to the data which has to be deleted |
Definition at line 491 of file link_list.c.
Delete node with matching index in Doublly LL and return the instance
d | - Pointer to instance of link list |
idx | - index of the node to be deleted |
Definition at line 818 of file link_list.c.
Delete node with matching data in Singly Circular LL and return the instance
d | - Pointer to instance of link list |
data | - Pointer to the data which has to be deleted |
Definition at line 556 of file link_list.c.
Delete node with matching index in Singly Circular LL and return the instance
d | - Pointer to instance of link list |
idx | - index of the node to be deleted |
Definition at line 879 of file link_list.c.
Delete node with matching data in singly LL and return the instance
d | - Pointer to instance of link list |
data | - Pointer to the data which has to be deleted |
Definition at line 433 of file link_list.c.
Delete node with matching index in singly LL and return the instance
d | - Pointer to instance of link list |
idx | - index of the node to be deleted |
Definition at line 764 of file link_list.c.
Delete node with matching data in xor link list
d | - Pointer to instance of link list |
data | - Pointer of data for the node to be deleted |
Definition at line 681 of file link_list.c.
Delete node with matching index in XOR LL and return the instance
d | - Pointer to instance of link list |
idx | - index of the node to be deleted |
Definition at line 1019 of file link_list.c.
void destroy_link_list | ( | t_gen | d | ) |
Destroy instance of the LL
d | - Pointer to instance of link list |
Definition at line 1373 of file link_list.c.
char* get_lltype_name | ( | e_lltype | type | ) |
Definition at line 1282 of file link_list.c.
Brief description. Find data in the link list.
d | - Pointer to instance of link list |
data | - Pointer to the data |
Definition at line 1130 of file link_list.c.
Get the end of link list
d | - Pointer to instance of link list |
Definition at line 1185 of file link_list.c.
Get the head node of link list
d | - Pointer to instance of link list |
Definition at line 1161 of file link_list.c.
Get the next node of given node in link list limitation for xor next node be it iterrates from head meaning first call should pass head node addr and next time next node and so on
d | - Pointer to instance of link list |
n | - Pointer to node whose next node is returned |
Definition at line 1217 of file link_list.c.
Fetch node data;
data | - Pointer to the node whose data to fetch |
Definition at line 110 of file link_list.c.
Get the prev node of given node in link list limitation for xor prev node be it iterrates from tail meaning first call should pass tail node addr and next time the node before tail and so on
d | - Pointer to instance of link list |
n | - Pointer to node whose prev node is returned |
Definition at line 1246 of file link_list.c.
Get the tail node of link list
d | - Pointer to instance of link list |
Definition at line 1173 of file link_list.c.
Get the i th node of the link list idx of node should be between 0 and < list count.
d | - Pointer to instance of link list |
idx | - idx, (0 <= idx < list count) |
Definition at line 1105 of file link_list.c.
int linklist_length | ( | t_gen | d | ) |
Length of the link list
d | - Pointer to instance of link list |
Definition at line 1091 of file link_list.c.
void linklist_print | ( | t_gen | d | ) |
Print the elems of link list
d | - Pointer to instance of link list |
Definition at line 1305 of file link_list.c.
void linklist_print_info | ( | t_gen | d | ) |
Print the elem in linklist with linkinfo
d | - Pointer to instance of link list |
Definition at line 1338 of file link_list.c.
Util fuction to complete xor operation between two pointers returns the xor'ed result as a t_gen type
Definition at line 240 of file link_list.c.
Look Up function ptrs for add based on type of list.
Definition at line 51 of file link_list.c.
f_ins append[] = {add_end_sll,add_end_dll,add_end_scll,add_end_dcll, add_end_xor_dll} |
Look Up function ptrs for apend (add end) based on type of list.
Definition at line 54 of file link_list.c.
f_del del[] = {del_node_sll, del_node_dll, del_node_scll, del_node_dcll, del_node_xor_dll} |
Look Up function ptrs for delete node based on type of list.
Definition at line 57 of file link_list.c.
f_del_idx del_idx[] = {del_node_sll_idx, del_node_dll_idx, del_node_scll_idx, del_node_dcll_idx, del_node_xor_idx} |
Look Up function ptrs for delete ith node based on type of list.
Definition at line 60 of file link_list.c.