项目作者: AliShaikh94

项目描述 :
3 dimensional k-d tree in SML
高级语言: Standard ML
项目地址: git://github.com/AliShaikh94/3D_BinarySearchTree_SML.git
创建时间: 2017-02-22T15:52:08Z
项目社区:https://github.com/AliShaikh94/3D_BinarySearchTree_SML

开源协议:

下载


3D_BinarySearchTree_SML

About

3 dimensional k-d tree in SML

The following methods are provided as easy access to the tree.
All of them(except DELETE) take paramters as follows: “ADD 45 6 7 mainTree”. The code is written in a strictly pattern matching/curryied style.

Command Examples

GENERATE

  1. Will generate a 3DBinode 10 deep to any valid Btree;

ADD oneD twoD threeD bTree

  1. Will add a node(s) at the desired location, givng the full path

DELETE dimList bTree

  1. Will delete a node(s). Must use following format: "DELETE [45,6,7] mainTree"

PRINT bTree = PrintTree [] bTree;

  1. Will print the tree.

SEARCH oneD twoD threeD bTree

  1. Will search the tree to check if item exists, with the full path

val myBTree = ADD/DELETE/SEARCH/GENERATE

  1. To assign the output of any function, use the above format with the respective parameters

val mynewBTree = Empty | Node(VALUE: int, left: BTree, right: BTree, down: BTree)

Variables

val mainTree = GENERATE(Empty, 10);

  1. An initially generated tree, with 10 randomly generated items.