Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 956 Categories, Downloaded 50.324.228 Times

Tree::Binary 0.07

  Date Added: August 26, 2010  |  Visits: 1.906

Tree::Binary

Report Broken Link
Printer Friendly Version


Product Homepage
Download (326 downloads)



Tree::Binary is a Object Oriented Binary Tree for Perl. SYNOPSIS use Tree::Binary; # a tree representaion of the expression: # ((2 + 2) * (4 + 5)) my $btree = Tree::Binary->new("*") ->setLeft( Tree::Binary->new("+") ->setLeft(Tree::Binary->new("2")) ->setRight(Tree::Binary->new("2")) ) ->setRight( Tree::Binary->new("+") ->setLeft(Tree::Binary->new("4")) ->setRight(Tree::Binary->new("5")) ); # Or shown visually: # +---(*)---+ # | | # +-(+)-+ +-(+)-+ # | | | | # (2) (2) (4) (5) # get a InOrder visitor my $visitor = Tree::Binary::Visitor::InOrderTraversal->new(); $btree->accept($visitor); # print the expression in infix order print $visitor->getAccumulation(); # prints "2 + 2 * 4 + 5" # get a PreOrder visitor my $visitor = Tree::Binary::Visitor::PreOrderTraversal->new(); $btree->accept($visitor); # print the expression in prefix order print $visitor->getAccumulation(); # prints "* + 2 2 + 4 5" # get a PostOrder visitor my $visitor = Tree::Binary::Visitor::PostOrderTraversal->new(); $btree->accept($visitor); # print the expression in postfix order print $visitor->getAccumulation(); # prints "2 2 + 4 5 + *" # get a Breadth First visitor my $visitor = Tree::Binary::Visitor::BreadthFirstTraversal->new(); $btree->accept($visitor); # print the expression in breadth first order print $visitor->getAccumulation(); # prints "* + + 2 2 4 5" # be sure to clean up all circular references $btree->DESTROY(); This module is a fully object oriented implementation of a binary tree. Binary trees are a specialized type of tree which has only two possible branches, a left branch and a right branch. While it is possible to use an n-ary tree, like Tree::Simple, to fill most of your binary tree needs, a true binary tree object is just easier to mantain and use. Binary Tree objects are especially useful (to me anyway) when building parse trees of things like mathematical or boolean expressions. They can also be used in games for such things as descisions trees. Binary trees are a well studied data structure and there is a wealth of information on the web about them. This module uses exceptions and a minimal Design By Contract style. All method arguments are required unless specified in the documentation, if a required argument is not defined an exception will usually be thrown. Many arguments are also required to be of a specific type, for instance the $tree argument to both the setLeft and setRight methods, must be a Tree::Binary object or an object derived from Tree::Binary, otherwise an exception is thrown. This may seems harsh to some, but this allows me to have the confidence that my code works as I intend, and for you to enjoy the same level of confidence when using this module. Note however that this module does not use any Exception or Error module, the exceptions are just strings thrown with die. This object uses a number of methods copied from another module of mine, Tree::Simple. Users of that module will find many similar methods and behaviors. However, it did not make sense for Tree::Binary to be derived from Tree::Simple, as there are a number of methods in Tree::Simple that just wouldnt make sense in Tree::Binary. So, while I normally do not approve of cut-and-paste code reuse, it was what made the most sense in this case..

Requirements: No special requirements
Platforms: Linux
Keyword: Binary Binary Tree Libraries New Object Object Oriented Object Oriented Binary Tree Programming Tree Treebinary Visitor
Users rating: 0/10

License: Freeware Size: 27.65 KB
USER REVIEWS
More Reviews or Write Review


TREE::BINARY RELATED
Programming  -  x10 0.3.2
X10 project is a new object-oriented, type-safe programming language for programming the next generation of high performance systems. X10 is designed and developed by IBM. While developed in close contact with the designers of X10 at IBM there...
8.1 MB  
Development Tools  -  What's New for Object-Oriented Programming in MATLAB Webinar - Code Examples 1.0
These are the code examples used in the "What's New for Object-Oriented Programming in MATLABdlT«" webinar, which described the new object oriented features in Release 2008a.To use the code, add the top folder to your path. See the test* M-files...
112.64 KB  
Code Management Tools  -  Virgil B-03
Virgil projetc is an new, object-oriented, light-weight programming language that is designed for building software for resource-constrained embedded systems at the lowest level. Microcontroller programmers can now develop complete software...
583.68 KB  
Libraries  -  PostScript::Graph::Style 1.02
SYNOPSIS Simplest Each time a new object is created the default style will be slightly different. use PostScript::File; use PostScript::Graph::Style; my $file = new PostScript::File(); my $seq = new PostScript::Graph::Sequence(); while...
55.3 KB  
Programming  -  boo rc.0.1
boo is a new object oriented statically typed programming language for the CLI (common language infrastructure) with a python inspired syntax and a special focus on language and compiler extensibility.
1.34 MB  
Programming  -  The Nice Programming Language 1.0
New object-oriented programming language based on Java, with the following advanced features: parametric types, anonymous functions, multi-methods, tuples, optional parameters.Nice also detects more errors during compilation (null pointers, casts).
1.29 MB  
Libraries  -  Set::Infinite 0.61
Set::Infinite Perl module contains sets of intervals. SYNOPSIS use Set::Infinite; $set = Set::Infinite->new(1,2); # [1..2] print $set->union(5,6); # [1..2],[5..6] Set::Infinite is a Set Theory module for infinite sets. A set is a...
49.15 KB  
Programming  -  Intrepid 2D Game Library 1.0
Intrepid is an object-oriented 2D game programming library written in C++ utilizing OpenGL and SDL that takes care of the low-level programming involved in making 2D games.You can create nearly every kind of 2D game. Comes with...
139.58 KB  
Programming  -  PyORQ 0.1
PyORQ (Python Object Relational binding with Queries) defines a new object-relational mapping. Native Python expressions which are translated automatically into SQL allow you to use the search capability of a relational database in an OO environment.
80.54 KB  
Libraries  -  Object::InsideOut 3.17
Object::InsideOut is a comprehensive inside-out object support module. SYNOPSIS package My::Class; { use Object::InsideOut; # Numeric field # With combined get+set accessor my @data :Field :Type(numeric) :Accessor(data); # Takes...
10.24 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB  
Libraries  -  wolfSSL 4.0.0
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
3.88 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB