B-tree Stack Class
Topics
:Overview
Conditional Directives
Constants
Type Definitions
Enumerations
Data Structures
Functions
The B-tree stack class is used by the non-recursive B-tree functions in place of the processor stack to store node addresses during non-recursive insertions and deletions. The B-tree stack class is essentially a doubly linked-list with stack and queue functions. The stack size is not fixed and grows according the height of the B-tree.
The B-tree stack node type is used to store a signal B-tree node address and pointers to the previous and next nodes in the stack.
struct BtreeStack_t { FAU node_address; // 32-bit or 64-bit B-tree node address BtreeStack_t *next; // Pointer to the next node in the stack BtreeStack_t *prev; // Pointer to the previous node in the stack };
BtreeStack::BtreeStack()
BtreeStack::~BtreeStack()
BtreeStack::AllocNode()
BtreeStack::Clear()
BtreeStack::DetachNode()
BtreeStack::Extract()
BtreeStack::FreeNode()
BtreeStack::GetHead()
BtreeStack::GetTail()
BtreeStack::Insert()
BtreeStack::InsertAfter()
BtreeStack::InsertBefore()
BtreeStack::IsEmpty()
BtreeStack::MakeEmpty()
BtreeStack::Pop()
BtreeStack::Push()
BtreeStack::RemoveHead()
BtreeStack::RemoveTail()
BtreeStack_t *BtreeStack::AllocNode(FAU node_address)
- Private member function used to allocate a new stack node for the specified B-tree node address. Returns null if memory could not be allocated or a pointer to the stack node if no errors occur.void BtreeStack::Clear()
- Public member function uses to clear the stack.void BtreeStack::DetachNode(BtreeStack_t *)
- Private member function used to detach the specified stack node from its current location - Public queue operation used to extract a B-tree node address from the list. Returns a file pointer to the B-tree node address.FAU BtreeStack::FreeNode(BtreeStack_t *n)
- Private member function used to free the memory location of the stack node. Returns a file pointer to the B-tree node address.BtreeStack_t *BtreeStack::GetHead()
- Public member function that returns the head of the list.BtreeStack_t *BtreeStack::GetTail()
- Public member function that returns the tail of the list.BtreeStack_t *BtreeStack::Insert(FAU node_address)
- Public queue operation used to insert a B-tree node address into the list. Returns a pointer to the stack node or a null value if memory for the node could not be allocated.void BtreeStack::InsertAfter(BtreeStack_t *pos, BtreeStack_t *n)
- Private member function used to insert a new or detached stack node after the node residing at the specified location.void BtreeStack::InsertBefore(BtreeStack_t *pos, BtreeStack_t *n)
- Private member function used to insert a new or detached stack node before the node residing at the specified location. - Public member function that returns true if the stack is empty. - Private member function used to reset the "head" and "tail" pointers. - Public stack operation used to pop a B-tree node address from the list. Returns a file pointer to the B-tree node address.BtreeStack_t *BtreeStack::Push(FAU node_address)
- Public stack operation used to push a B-tree node address into the list. Returns a pointer to the stack node or a null value if memory for the node could not be allocated. - Private member function used to remove the first stack node in the list. Returns a file pointer to the B-tree node address. - Private member function used to remove the last stack node in the list. Returns a file pointer to the B-tree node address.
End Of Document |