Tag Archives: AVL Tree

SeganX Foundation

Well. after more attempts finally the SeganX foundation is now completed and ready to use. It separated into different groups and namespaces without any STL footprints.
At first glance, the reason is purely personal, but when you look deeply into this decision, you will find the most important technical advantage of writing the entire internal library!
Practice!
Just as every athlete needs to practice his skills, this exercise, in addition to increasing knowledge about data containers and algorithms, increases your coding skills and makes you think more and more about solving problems.

The SeganX foundation covers the tools listed below:

sxLib: the most independent library that contains the basic container classes and functions.

String: Standard String that uses standard OS memory management to store data.
String_inline: Fast String that uses a hybrid memory pool to store data. It’s suitable for local/temp variables in functions. and should not implemented in classes as a member!
String_256: Type of String that uses 256 fixed-size string.
String_512: Type of String that uses 512 fixed-size string.
String_1024: Type of String that uses 1024 fixed size string.

Array: Standard Array that uses standard OS memory management to store data.
Array_inline: Fast type of Array that uses a hybrid memory pool to store data. It’s suitable for local/temp variables in functions. and should not implemented in classes as a member!
Array_fix<T, MaxPush>: Fast type of Array that uses fixed size memory block to store/restore data.

List: Standard List that uses OS memory management to store/restore data.
List_256: Fast type of List that can hold a maximum 256 number of objects.
List_512: Fast type of List that can hold a maximum 512 number of objects.
List_fix<T, MaxPush>: Fast type of List that uses a memory pool to store/restore data.

Queue: Standard Queue that uses OS memory management to store/restore data.
Queue_fix<T, MaxPush>: Fast type of Queue that uses a memory pool to store/restore data.
Queue_256: Fast type of Queue that can hold a maximum 256 number of objects.
Queue_512: Fast type of Queue that can hold a maximum 512 number of objects.

Stack: Standard Stack that uses standard OS memory management to store data.
Stack_inline: Fast type of Stack that uses a hybrid memory pool to store data. It’s suitable for local/temp variables in functions. and should not implemented in classes as a member!
Stack_fix<T, MaxPush>: Fast type of Stack that uses fixed size memory block to store/restore data.

Here the Map container uses AVL Tree and as you know it’s one of the Self-Balanced Binary Search Tree. Although there are some drawbacks in insertion and deletion it has a fast search ( O(log n) ) and I will use its search frequently. here are some types of my maps:
Map<key, type>: Standard Map that uses OS memory management to store/restore data.
Map_256<key, type>: Fast type of Map that can hold a maximum 256 number of objects.
Map_512<key, type>: Fast type of Map that can hold a maximum 512 number of objects.
Map_fix<key, type, MaxPush>: Fast type of Map that uses a memory pool to store/restore data.

In addition, there are two memory pool types, three memory manager types, a base of streams a memory stream class, and some tools in sxClasses that are boring to describe.

sxSys: this library contains more system tools and functions:
Window class is a simple class to create and modify a window.
Application Is the main class that no need to create. this class is responsible for managing windows, running, and controlling the project.
System Functions are a series of functions to get system info, CPU cores monitoring, power management monitoring to keep the system wake up full, working with files, folders, disk drives, etc.
The other things that exist in namespace sxSys are threads and task manager, log system, and some additional useful functions for numbers and strings. these tools and functions need sxLib to compile.

some other parts, rendering system, engine, editor, etc are under development.