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

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

Serving Software Downloads in 976 Categories, Downloaded 29.981.570 Times

Tree::Binary 0.07

  Date Added: August 26, 2010  |  Visits: 999

Tree::Binary

Report Broken Link
Printer Friendly Version


Product Homepage
Download (268 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
TREE::BINARY RELATED
Development Editors  -  XdevL 0.2.0
XdevL is a powerful cross-platform C++ Object and Plug-In Oriented programming framework which helps you developing real-time applications. The whole system can be extended using additional Plug-In's which makes it extreme flexible.
1.71 MB  
Libraries  -  Locale::Object::Language 0.75
Locale::Object::Language Perl module contains language information objects. Locale::Object::Language allows you to create objects containing information about languages such as their ISO codes, the countries theyre used in and so on. SYNOPSIS...
47.1 KB  
Libraries  -  Perlbug::Object 2.93
Perlbug::Object is a object handler for Perlbug database. Handles Perlbug database objects, typically bug, group, message, patch, note, test, user, and severity, status etc.... Methods included to recognise objects by their id or by their also...
501.76 KB  
Libraries  -  Pod::POM 0.17
Pod::POM is a POD Object Model. SYNOPSIS use Pod::POM; my $parser = Pod::POM->new(%options); # parse from a text string my $pom = $parser->parse_text($text) || die $parser->error(); # parse from a file specified by name or filehandle...
34.82 KB  
Development Editors  -  bpe 2.01.00
Bpe is a relatively-simple and easy-to-use, screen-oriented, curses-based binary editor. I picked up a copy of the bpe source from Ralphe Neill's web site and decided to convert it to autoconf/automake, rather than the hardcoded list of...
112.64 KB  
Programming  -  Gtk2::Ex::Simple::Tree for Linux 0.50
Gtk2 has a powerful, but complex MVC (Model, View, Controller) system used to implement list and tree widgets. The Gtk2::Ex::Simple::Tree Perl module automates the complex setup work and allows you to treat the tree model as a more natural list of...
10.24 KB  
Libraries  -  EZMorph 1.0.3
EZMorph is simple Java library for transforming an Object to another Object. It supports transformations for primitives, Objects, and multidimensional arrays, compatibility with JDK 1.3.1, and small memory footprint (~60K). EZMorph began life...
65.54 KB  
Libraries  -  C Generic Library 0.4.2
C Generic Library is a generic data structure library is a bunch of data structures that are designed and created in as generic a fashion as possible. Each data structure will contain its own basic memory management, be able to handle any object...
26.62 KB  
Programming  -  Logtalk 2.30.3
Logtalk is an open source object-oriented extension to the Prolog programming language. Integrating logic programming with object-oriented and event-driven programming, it is compatible with most Prolog compilers. Logtalk supports both...
604.16 KB  
Programming  -  ObjectiveLib 1.0
ObjectiveLib is a library for Objective-C that provides a full set of object containers, generic algorithms and binary streams. It provides the same services to Objective-C programmers that the Standard Template Library provides to C++ programmers.
808.96 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  FLEX-db Digital Asset Manager 3.0.9
FLEX-db - an enterprise Digital Asset Manager (DAM). It ingests and links metadata with files, creates thumbnails, and processes files using business rules. FLEX-db has a JSP client, Java app server for file input and output and an EJB metadata...
21.57 MB  
Programming  -  Libicom 0.9.0
The libicom library is a character based dynamicly linked library for Linux. It is used to remotely control the Icom IC-R8500 wide band receiver via an RS232 link. All call and return parameters to the control functions are character string based....
20.48 KB  
Programming  -  dotdesktop 0.3
Dotdesktop library provides ability to parse desktop entry file and access the information in a convenient way. Desktop entry file format is defined by freedesktop.org, it is used to describe information about an application such as the name and...
327.68 KB  
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  -  libyasl 0.2
Libyasl is a C++ class library to easily realize TCP/UDP/Multicast clientsand servers in IPv4 and IPv6 environments under GNU/Linux systems.
143.36 KB  
Libraries  -  wolfSSL 3.12.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...
2.73 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