📄 _gdsl_bstree.3
字号:
.RE.PP\fBParameters:\fP.RS 4\fIT\fP The low-level binary search tree to use. .RE.PP\fBReturns:\fP.RS 4the right sub-tree of the low-level binary search tree T if T has a right sub-tree. .PPNULL if the low-level binary search tree T has no right sub-tree. .RE.PP\fBSee also:\fP.RS 4\fB_gdsl_bstree_get_left()\fP .RE.PP.SS "\fBulong\fP _gdsl_bstree_get_size (const \fB_gdsl_bstree_t\fP T)".PPGet the size of a low-level binary search tree. .PP\fBNote:\fP.RS 4Complexity: O( |T| ) .RE.PP\fBPrecondition:\fP.RS 4nothing. .RE.PP\fBParameters:\fP.RS 4\fIT\fP The low-level binary search tree to compute the size from. .RE.PP\fBReturns:\fP.RS 4the number of elements of T (noted |T|). .RE.PP\fBSee also:\fP.RS 4\fB_gdsl_bstree_get_height()\fP .RE.PP.SS "\fBulong\fP _gdsl_bstree_get_height (const \fB_gdsl_bstree_t\fP T)".PPGet the height of a low-level binary search tree. .PPCompute the height of the low-level binary search tree T (noted h(T))..PP\fBNote:\fP.RS 4Complexity: O( |T| ) .RE.PP\fBPrecondition:\fP.RS 4nothing. .RE.PP\fBParameters:\fP.RS 4\fIT\fP The low-level binary search tree to compute the height from. .RE.PP\fBReturns:\fP.RS 4the height of T. .RE.PP\fBSee also:\fP.RS 4\fB_gdsl_bstree_get_size()\fP .RE.PP.SS "\fB_gdsl_bstree_t\fP _gdsl_bstree_insert (\fB_gdsl_bstree_t\fP * T, const \fBgdsl_compare_func_t\fP COMP_F, const \fBgdsl_element_t\fP VALUE, int * RESULT)".PPInsert an element into a low-level binary search tree if it's not found or return it. .PPSearch for the first element E equal to VALUE into the low-level binary search tree T, by using COMP_F function to find it. If an element E equal to VALUE is found, then it's returned. If no element equal to VALUE is found, then E is inserted and its root returned..PP\fBNote:\fP.RS 4Complexity: O( h(T) ), where log2(|T|) <= h(T) <= |T|-1 .RE.PP\fBPrecondition:\fP.RS 4COMP_F != NULL & RESULT != NULL. .RE.PP\fBParameters:\fP.RS 4\fIT\fP The reference of the low-level binary search tree to use. .br\fICOMP_F\fP The comparison function to use to compare T's elements with VALUE to find E. .br\fIVALUE\fP The value used to search for the element E. .br\fIRESULT\fP The address where the result code will be stored. .RE.PP\fBReturns:\fP.RS 4the root containing E and RESULT = GDSL_INSERTED if E is inserted. .PPthe root containing E and RESULT = GDSL_ERR_DUPLICATE_ENTRY if E is not inserted. .PPNULL and RESULT = GDSL_ERR_MEM_ALLOC in case of failure. .RE.PP\fBSee also:\fP.RS 4\fB_gdsl_bstree_search()\fP .PP\fB_gdsl_bstree_remove()\fP .RE.PP.SS "\fBgdsl_element_t\fP _gdsl_bstree_remove (\fB_gdsl_bstree_t\fP * T, const \fBgdsl_compare_func_t\fP COMP_F, const \fBgdsl_element_t\fP VALUE)".PPRemove an element from a low-level binary search tree. .PPRemove from the low-level binary search tree T the first founded element E equal to VALUE, by using COMP_F function to compare T's elements. If E is found, it is removed from T..PP\fBNote:\fP.RS 4Complexity: O( h(T) ), where log2(|T|) <= h(T) <= |T|-1 .PPThe resulting T is modified by examinating the left sub-tree from the founded e. .RE.PP\fBPrecondition:\fP.RS 4COMP_F != NULL. .RE.PP\fBParameters:\fP.RS 4\fIT\fP The reference of the low-level binary search tree to modify. .br\fICOMP_F\fP The comparison function to use to compare T's elements with VALUE to find the element e to remove. .br\fIVALUE\fP The value that must be used by COMP_F to find the element e to remove. .RE.PP\fBReturns:\fP.RS 4the fisrt founded element equal to VALUE in T. .PPNULL if no element equal to VALUE is found or if T is empty. .RE.PP\fBSee also:\fP.RS 4\fB_gdsl_bstree_insert()\fP .PP\fB_gdsl_bstree_search()\fP .RE.PP.SS "\fB_gdsl_bstree_t\fP _gdsl_bstree_search (const \fB_gdsl_bstree_t\fP T, const \fBgdsl_compare_func_t\fP COMP_F, const \fBgdsl_element_t\fP VALUE)".PPSearch for a particular element into a low-level binary search tree. .PPSearch the first element E equal to VALUE in the low-level binary search tree T, by using COMP_F function to find it..PP\fBNote:\fP.RS 4Complexity: O( h(T) ), where log2(|T|) <= h(T) <= |T|-1 .RE.PP\fBPrecondition:\fP.RS 4COMP_F != NULL. .RE.PP\fBParameters:\fP.RS 4\fIT\fP The low-level binary search tree to use. .br\fICOMP_F\fP The comparison function to use to compare T's elements with VALUE to find the element E. .br\fIVALUE\fP The value that must be used by COMP_F to find the element E. .RE.PP\fBReturns:\fP.RS 4the root of the tree containing E if it's found. .PPNULL if VALUE is not found in T. .RE.PP\fBSee also:\fP.RS 4\fB_gdsl_bstree_insert()\fP .PP\fB_gdsl_bstree_remove()\fP .RE.PP.SS "\fB_gdsl_bstree_t\fP _gdsl_bstree_search_next (const \fB_gdsl_bstree_t\fP T, const \fBgdsl_compare_func_t\fP COMP_F, const \fBgdsl_element_t\fP VALUE)".PPSearch for the next element of a particular element into a low-level binary search tree, according to the binary search tree order. .PPSearch for an element E in the low-level binary search tree T, by using COMP_F function to find the first element E equal to VALUE..PP\fBNote:\fP.RS 4Complexity: O( h(T) ), where log2(|T|) <= h(T) <= |T|-1 .RE.PP\fBPrecondition:\fP.RS 4COMP_F != NULL. .RE.PP\fBParameters:\fP.RS 4\fIT\fP The low-level binary search tree to use. .br\fICOMP_F\fP The comparison function to use to compare T's elements with VALUE to find the element E. .br\fIVALUE\fP The value that must be used by COMP_F to find the element E. .RE.PP\fBReturns:\fP.RS 4the root of the tree containing the successor of E if it's found. .PPNULL if VALUE is not found in T or if E has no sucessor. .RE.PP.SS "\fB_gdsl_bstree_t\fP _gdsl_bstree_map_prefix (const \fB_gdsl_bstree_t\fP T, const \fB_gdsl_bstree_map_func_t\fP MAP_F, void * USER_DATA)".PPParse a low-level binary search tree in prefixed order. .PPParse all nodes of the low-level binary search tree T in prefixed order. The MAP_F function is called on each node with the USER_DATA argument. If MAP_F returns GDSL_MAP_STOP, then \fB_gdsl_bstree_map_prefix()\fP stops and returns its last examinated node..PP\fBNote:\fP.RS 4Complexity: O( |T| ) .RE.PP\fBPrecondition:\fP.RS 4MAP_F != NULL. .RE.PP\fBParameters:\fP.RS 4\fIT\fP The low-level binary search tree to map. .br\fIMAP_F\fP The map function. .br\fIUSER_DATA\fP User's datas passed to MAP_F. .RE.PP\fBReturns:\fP.RS 4the first node for which MAP_F returns GDSL_MAP_STOP. .PPNULL when the parsing is done. .RE.PP\fBSee also:\fP.RS 4\fB_gdsl_bstree_map_infix()\fP .PP\fB_gdsl_bstree_map_postfix()\fP .RE.PP.SS "\fB_gdsl_bstree_t\fP _gdsl_bstree_map_infix (const \fB_gdsl_bstree_t\fP T, const \fB_gdsl_bstree_map_func_t\fP MAP_F, void * USER_DATA)".PPParse a low-level binary search tree in infixed order. .PPParse all nodes of the low-level binary search tree T in infixed order. The MAP_F function is called on each node with the USER_DATA argument. If MAP_F returns GDSL_MAP_STOP, then \fB_gdsl_bstree_map_infix()\fP stops and returns its last examinated node..PP\fBNote:\fP.RS 4Complexity: O( |T| ) .RE.PP\fBPrecondition:\fP.RS 4MAP_F != NULL. .RE.PP\fBParameters:\fP.RS 4\fIT\fP The low-level binary search tree to map. .br\fIMAP_F\fP The map function. .br\fIUSER_DATA\fP User's datas passed to MAP_F. .RE.PP\fBReturns:\fP.RS 4the first node for which MAP_F returns GDSL_MAP_STOP. .PPNULL when the parsing is done. .RE.PP\fBSee also:\fP.RS 4\fB_gdsl_bstree_map_prefix()\fP .PP\fB_gdsl_bstree_map_postfix()\fP .RE.PP.SS "\fB_gdsl_bstree_t\fP _gdsl_bstree_map_postfix (const \fB_gdsl_bstree_t\fP T, const \fB_gdsl_bstree_map_func_t\fP MAP_F, void * USER_DATA)".PPParse a low-level binary search tree in postfixed order. .PPParse all nodes of the low-level binary search tree T in postfixed order. The MAP_F function is called on each node with the USER_DATA argument. If MAP_F returns GDSL_MAP_STOP, then \fB_gdsl_bstree_map_postfix()\fP stops and returns its last examinated node..PP\fBNote:\fP.RS 4Complexity: O( |T| ) .RE.PP\fBPrecondition:\fP.RS 4MAP_F != NULL. .RE.PP\fBParameters:\fP.RS 4\fIT\fP The low-level binary search tree to map. .br\fIMAP_F\fP The map function. .br\fIUSER_DATA\fP User's datas passed to MAP_F. .RE.PP\fBReturns:\fP.RS 4the first node for which MAP_F returns GDSL_MAP_STOP. .PPNULL when the parsing is done. .RE.PP\fBSee also:\fP.RS 4\fB_gdsl_bstree_map_prefix()\fP .PP\fB_gdsl_bstree_map_infix()\fP .RE.PP.SS "void _gdsl_bstree_write (const \fB_gdsl_bstree_t\fP T, const \fB_gdsl_bstree_write_func_t\fP WRITE_F, FILE * OUTPUT_FILE, void * USER_DATA)".PPWrite the content of all nodes of a low-level binary search tree to a file. .PPWrite the nodes contents of the low-level binary search tree T to OUTPUT_FILE, using WRITE_F function. Additionnal USER_DATA argument could be passed to WRITE_F..PP\fBNote:\fP.RS 4Complexity: O( |T| ) .RE.PP\fBPrecondition:\fP.RS 4WRITE_F != NULL& OUTPUT_FILE != NULL. .RE.PP\fBParameters:\fP.RS 4\fIT\fP The low-level binary search tree to write. .br\fIWRITE_F\fP The write function. .br\fIOUTPUT_FILE\fP The file where to write T's nodes. .br\fIUSER_DATA\fP User's datas passed to WRITE_F. .RE.PP\fBSee also:\fP.RS 4\fB_gdsl_bstree_write_xml()\fP .PP\fB_gdsl_bstree_dump()\fP .RE.PP.SS "void _gdsl_bstree_write_xml (const \fB_gdsl_bstree_t\fP T, const \fB_gdsl_bstree_write_func_t\fP WRITE_F, FILE * OUTPUT_FILE, void * USER_DATA)".PPWrite the content of a low-level binary search tree to a file into XML. .PPWrite the nodes contents of the low-level binary search tree T to OUTPUT_FILE, into XML language. If WRITE_F != NULL, then use WRITE_F function to write T's nodes contents to OUTPUT_FILE. Additionnal USER_DATA argument could be passed to WRITE_F..PP\fBNote:\fP.RS 4Complexity: O( |T| ) .RE.PP\fBPrecondition:\fP.RS 4OUTPUT_FILE != NULL. .RE.PP\fBParameters:\fP.RS 4\fIT\fP The low-level binary search tree to write. .br\fIWRITE_F\fP The write function. .br\fIOUTPUT_FILE\fP The file where to write T's nodes. .br\fIUSER_DATA\fP User's datas passed to WRITE_F. .RE.PP\fBSee also:\fP.RS 4\fB_gdsl_bstree_write()\fP .PP\fB_gdsl_bstree_dump()\fP .RE.PP.SS "void _gdsl_bstree_dump (const \fB_gdsl_bstree_t\fP T, const \fB_gdsl_bstree_write_func_t\fP WRITE_F, FILE * OUTPUT_FILE, void * USER_DATA)".PPDump the internal structure of a low-level binary search tree to a file. .PPDump the structure of the low-level binary search tree T to OUTPUT_FILE. If WRITE_F != NULL, then use WRITE_F function to write T's nodes content to OUTPUT_FILE. Additionnal USER_DATA argument could be passed to WRITE_F..PP\fBNote:\fP.RS 4Complexity: O( |T| ) .RE.PP\fBPrecondition:\fP.RS 4OUTPUT_FILE != NULL. .RE.PP\fBParameters:\fP.RS 4\fIT\fP The low-level binary search tree to dump. .br\fIWRITE_F\fP The write function. .br\fIOUTPUT_FILE\fP The file where to write T's nodes. .br\fIUSER_DATA\fP User's datas passed to WRITE_F. .RE.PP\fBSee also:\fP.RS 4\fB_gdsl_bstree_write()\fP .PP\fB_gdsl_bstree_write_xml()\fP .RE.PP
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -