Delete an item from a left-threaded AVL tree.
Searches AVL tree TREE for an item matching ITEM. If found, the item is removed from the tree and the actual item found is returned to the caller. If no item matching ITEM exists in the tree, returns NULL.
Destroy tree TREE.
Function FREE_FUNC is called for every node in the tree as it is destroyed.
No effect if the tree has an arena owner and free_func is NULL. The caller owns the arena and must destroy it itself.
Do not attempt to reuse the tree after it has been freed. Create a new one.
Search the left-threaded AVL tree for an item.
Search TREE for an item matching ITEM, and return a pointer to it if found.
Search a left-threaded AVL tree for an item close to a given value.
Search TREE for an item close to the value of ITEM, and return it. This function will return a null pointer only if TREE is empty.
Returns:
An item close to the one sought, or NULL if the tree is empty.
Free a TREE.
avltr_destroy() (p.pagenum) with FREE_FUNC hardcoded as free().
Inserts ITEM into TREE.
Returns NULL if the item was inserted, otherwise a pointer to the duplicate item.
Return the next item in the left-threaded AVL tree.
Given ITEM, a pointer to a data item in TREE (or NULL), returns a pointer to the next item in the tree in comparison order, or NULL if ITEM is the last item.
Insert an item into a left-threaded AVL tree if no matching item is found.
Search TREE for an item matching ITEM. If found, returns a pointer to the address of the item. If none is found, ITEM is inserted into the tree, and a pointer to the address of ITEM is returned. In either case, the pointer returned can be changed by the caller, or the returned data item can be directly edited, but the key data in the item must not be changed.
Returns:
The item found, or the a pointer to the newly inserted item.
Replace an item in a left-threaded AVL tree.
If ITEM does not exist in TREE, inserts it and returns NULL. If a matching item does exist, it is replaced by ITEM and the item replaced is returned. The caller is responsible for freeing the item returned.
Threads the unthreaded AVL tree TREE in-place.
Returns:
TREE cast to avltr_tree (p.pagenum) (a threaded tree)
Traverse a left threaded AVL tree.
Each call to this function for a given TREE and TRAV return the next item in the tree in inorder. Initialize the first element of TRAV (init) to 0 before calling the first time.
Returns:
Next item in the tree in 'inorder'. NULL when out of elements.
Unthreads the threaded tree TREE in-place.
Returns:
An unthreded TREE cast to an avl_tree.
Walk tree TREE in inorder, calling WALK_FUNC at each node.
Parameters:
tree The tree
walk_func Function to be called at each node along our path.
param parameters for the walk_func function
Delete ITEM from TREE when you know that ITEM must be in TREE.
For debugging purposes.
seisio File object.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "seisio.h"
Уважаемый посетитель!
Чтобы распечатать файл, скачайте его (в формате Word).
Ссылка на скачивание - внизу страницы.