class LTree

Overview

Basic implementation of a Tree data structure. Implemented using a List to accomodate N children per node.

NOTE Children in the Array are not sorted. This means the only way to traverse/search the tree is brute force, but for the current use case this isn't necessary.

Defined in:

l_tree.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(value : String, parent : LTree | Nil = nil) #

[View source]
def self.new(value : String, children : Array(LTree), parent : LTree | Nil = nil) #

[View source]

Instance Method Detail

def add(text) #

[View source]
def children : Array(LTree) #

[View source]
def leaves #

[View source]
def parent : LTree? #

[View source]
def root #

[View source]
def value : String #

[View source]