Graph:...edTree(3pm)

πŸ’– Graph::Maker::BalancedTree πŸ’–

okay so bestie, welcome to Graph::Maker::BalancedTree β€” it's a page from the User Contributed Perl Documentation collection (perl v5.32.1, if you're keeping score) and it does exactly one thing and does it gorgeously: it builds you a balanced tree. 🌳✨


🌸 NAME 🌸

Graph::Maker::BalancedTree β€” creates a balanced tree with a specified fan out and height. that's it, that's the whole job, and she's iconic for it.


πŸŽ€ VERSION πŸŽ€

Version 0.01. baby's first version, and we stan. πŸ‘‘


✨ SYNOPSIS ✨

So here's the vibe: you get a tree of the height you asked for, with a fan out of fan_out. and here's the lil plot twist β€” if the graph is directed, then edges are added in both directions to create an undirected graph. yes bestie, she's making it undirected whether you like it or not. πŸ’…

use strict;
use warnings;
use Graph;
use Graph::Maker;
use Graph::Maker::BalancedTree;

my $g = new Graph::Maker('balanced_tree', fan_out => 3, height => 3);
# work with the graph

like, look at her. fan_out => 3, height => 3, and then you just go work with the graph. main character energy fr fr. πŸ¦‹


🧚 FUNCTIONS 🧚

new %params

Creates a tree with the height and fan out you asked for. 🫢

the parameters are:

  • graph_maker
  • fan_out β€” and she needs fan_out >= 2, no exceptions bestie
  • height β€” and this one needs height >= 1

…and honestly any other params you throw in there get passed straight onto Graph's constructor, no gatekeeping. 🌈

and if graph_maker is specified, it gets called to create the Graph class β€” super handy if you've got your own subclass of Graph, iykyk. otherwise? it just defaults to creating a Graph with the parameters you specified. easy. πŸ“


πŸ’œ AUTHOR πŸ’œ

Matt Spear, "<batman900+cpan at gmail.com>" β€” go say hi, he made this. πŸ‘‘


πŸ’€ BUGS πŸ’€

None at the moment... (not me being suspiciously confident, but okay bestie, we love a clean slate ✨)

Please report any bugs or feature requests to "bug-graph-maker-balancedtree at rt.cpan.org", or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Graph-Maker>.

and the way this works is: he'll be notified, and then you'll automatically be notified of progress on your bug as he makes changes. mutual updates, we love to see it. πŸ’–


Copyright 2008 Matt Spear, all rights reserved. πŸ“

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. slay.


and that's the whole page bestie β€” every flag, every constraint, every email, nothing skipped. go build some balanced trees, you've got this. πŸŒ³πŸ’…

signing off with love from perl v5.32.1, dated 2021-08-27, brought to you by Graph:...edTree(3pm) β€” yeah the header got cut off mid-word, she's a little mysterious like that πŸŽ€βœ¨

πŸ“¦ where this page comes from