GithubHelp home page GithubHelp logo

random-binary-tree's Introduction

Comparing shapes of randomly generated binary search trees without balancing

This repository contains the code for a research project, regarding the balancedness of a random tree, as part of a course of the University of Utrecht.

Abstract

When binary search trees are generated from an uniformly shuffled list of numbers using only random inserts they become balanced. Interestingly enough not much is known about also performing random deletions. Using several different methods of generating binary search trees, such as for every random insertion also performing a random deletion, we can deduce if such trees end up balanced. This would mean that trees generated by random inputs and deletes do not necessarily need a balancing algorithm. By comparing the results of these different methods our research concludes that most trees likely become balanced, our research is however limited by the amount of nodes we can realistically add or remove.

How to run

  • Install the Haskell platform
  • Build using GHC: ghc trees.hs -threaded -rtsopts
  • Run: time ./trees +RTS -N4 -M7G. The last number specifies the maximum heap size, set this depending on the amount of RAM on your computer.

random-binary-tree's People

Contributors

ivogabe avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.