Giter Club home page Giter Club logo

bst-rs's Introduction

Hiya, I'm Goudham ๐Ÿ‘‹

I care a lot about open-source software.

  • ๐Ÿ”ญ ย I study and work at the same time, learn more about that here.
  • ๐ŸŒฑ ย I'm endlessly curious and love learning about anything.
  • ๐Ÿ’ฌ ย Ask me about anything related to Java/Python/Rust and/or microservice architectures.
  • ๐ŸŽจ ย I like pretty colours.
Octo Ring logo
previousrandomnext
check out other GitHub profiles in the Octo Ring

bst-rs's People

Contributors

nassersaazi avatar nyxkrage avatar sgoudham avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

nyxkrage

bst-rs's Issues

[v0.1.1] -> Add bst![] macro defaulting to IterativeBST

Motivation

Users can currently only use IterativeBST & RecursiveBST structs directly for creating BinarySearchTrees. We should streamline this process by implementing a declarative macro that can instantiate the tree for them that defaults to the IterativeBST implementation.

E.G Given the user wants to represent the following tree:

graph TB;
    A((8))-->B((3))
    A-->C((10))
    B-->D((1))
    B-->E((6))
    C-->F((9))
	C-->G((15))

The code could look like:

let mut bst = bst![8, 10, 9, 15, 3, 6, 1];

What We Need To Do

Add bst![] macro that defaults to the IterativeBST implementation.

[v0.1.1] -> Add retrieval methods for Predecessor & Successor

Context

Common operations surrounding BST's are retrieving Predecessor & Successor Successors.
The definitions of both terms are as follows:

Successor

The Successor can be thought of as the smallest value greater than the value of the given node.

E.G. Given a tree that looks like:

graph TB;
    A((8))-->B((3))
    A-->C((10))
    B-->D((1))
    B-->E((6))
    C-->F((9))
    C-->G((14))
    E-->H((4))
    E-->I((7))

The Successor of 3 is 4.

Predecessor

The Predecessor can be thought of as the greatest value less than the value of the given node.

E.G Given a tree that looks like:

graph TB;
    A((8))-->B((3))
    A-->C((10))
    B-->D((1))
    B-->E((6))
    C-->F((9))
    C-->G((14))
    E-->H((4))
    E-->I((7))

The Predecessor of 8 is 7.

What We Need To Do

Successor & Predecessor retrieval methods should implemented as part of the BinarySearchTree trait and implemented within RecursiveBST & IterativeBST

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.