- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
rs_tree.h
资源名称:leda.tar.gz [点击查看]
上传用户:gzelex
上传日期:2007-01-07
资源大小:707k
文件大小:1k
源码类别:
数值算法/人工智能
开发平台:
MultiPlatform
- /*******************************************************************************
- +
- + LEDA-R 3.2.3
- +
- + rs_tree.h
- +
- + Copyright (c) 1995 by Max-Planck-Institut fuer Informatik
- + Im Stadtwald, 66123 Saarbruecken, Germany
- + All rights reserved.
- +
- *******************************************************************************/
- #ifndef LEDA_RS_TREE_H
- #define LEDA_RS_TREE_H
- //------------------------------------------------------------------------------
- //
- // rs_tree:
- //
- // randomized search trees (derived from class "bin_tree")
- //
- // Stefan N"aher (1993)
- //
- //------------------------------------------------------------------------------
- #include <LEDA/basic.h>
- #include <LEDA/impl/bin_tree.h>
- typedef bin_tree_node* rs_tree_item;
- //-----------------------------------------------------------------
- // class rs_tree
- //-----------------------------------------------------------------
- class rs_tree : public bin_tree
- {
- int root_balance() { return rand_int.get(); }
- int node_balance() { return rand_int.get(); }
- int leaf_balance() { return 0; }
- void insert_rebal(rs_tree_item);
- void del_rebal(rs_tree_item, rs_tree_item);
- public:
- rs_tree() {}
- ~rs_tree() {}
- rs_tree(const rs_tree& T) : bin_tree(T) {}
- rs_tree& operator=(const rs_tree& T) { bin_tree::operator=(T); return *this; }
- };
- #endif