Skip to content

adoudf/BTrees_Structure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Balanced B-Tree Implementation

This C++ program implements a balanced B-tree data structure with basic operations like insertion and range search.

To compile: make all To execure: make run To clean: make clean

Note use valgrind to verify proper memory deallocation

Introduction

This program defines a balanced B-tree structure and provides methods for insertion and searching within a specified range. The B-tree is a self-balancing tree data structure that maintains sorted data and allows searches, sequential access, insertions, and deletions in logarithmic time. The tree is built while generating the keys.

Usage

To use this implementation, include the necessary header files and use the BalancedTree class to perform operations on the B-tree.

Methods

BalancedTree

  • Constructor: Initializes the B-tree with a null root.

~BalancedTree

  • Destructor: Frees memory allocated for the tree nodes.

insert(int key)

  • Inserts a new key into the B-tree.

searchForKeys(int smallest, int largest)

  • Searches for keys within a specified range and returns a vector of matching keys.

displayTree()

  • Displays the keys of the B-tree in sorted order.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published