WLOG - blog something different

tags: ai arduino bass games godot i2c linux plan9 random rv web werc zig
The importance of pruning and balancig trees
link | random | Sun Apr 07 21:48:27 CET 2024 No.34

What about this weather we’re having?

Ah well, at least the laws of equal exchange agree with exchanging screen time with fresh air.

But let’s discuss balancing tree structures.

Adding new nodes and branches is usually quite a straightforward operation. Most of the time you don’t have to do anything, the structure grows on its own. But without any kind of supervision or maintenance, it will grow into a random, hard to traverse mess that just wastes resources.

Before picture

So it is important to either implement proper growing algorithems into the structure itself or do some manual pruning manualy.

After picture

Now, whether it be databases or file system structures, it is best practice to do the balancing operations at off peak activity times.

And if you’re developing custom algorithms, document them! Take good snapshots of before and after states for studying.