Code Monkey home page Code Monkey logo

bst-countwords's People

Contributors

marcellonicoletti avatar mnicole1 avatar

Watchers

 avatar

bst-countwords's Issues

Add node rotation functions

Sub-issue of #16

Rotations maintain the rules of the binary search tree while changing the structure. They are essential to a basic self balancing tree.

roatations

Add toArray functions

Add functions allowing to return an array of NodeData of all the keys in the tree with an in order traversal. Could be used to populate a heap to get words in order of most to least (or vise-versa) common.

Add height functions

Sub-issue of #16

Rebalance is triggered when the difference between a node's left and right branchs' height exceeds 2. We need to know the height to do that.

Add min and max functions

Sub-issue of #10

Getting the min or max of a child is one step of replacing a node to be removed.

Also just handy to have.

Insert has no success indication

I cannot maintain an accurate size tally. Change insert from void to bool/int to indicate whether a key was new or a repeat. (true = new -> increment size tally)

Create test word file

Create a file populated with many words with some of them duplicated. Will use this to test reading from a file.

Add remove operation

The three primary operations for a BST are Insert, Search, Remove. I only have one of those currently. This will have some "sub-issues" surrounding auxiliary operations such as max & min.

Add search operation

The three primary operations for a BST are Insert, Search, Remove. I only have one of those currently. Should return a NodeData type pointer and allow caller to deal with raw NodeData.

Create tree debug function

This function will help illustrate the tree structure. Will have some way of indicating relationship between nodes containing the words not just the words in order.

Add Self-Balancing Functionality to tree

Binary Search Trees optimize lookup by reducing the number of comparisons that need to be made by eliminating possibilities. In ideal cases BSTs can search in O(log_2(n)) but this requires the tree to be well balanced. If a tree isn't well balanced well ordered inputs can cause a bad case where search approaches or is O(n). To counter this the tree should keep itself pretty well balanced. This will produce little overhead on insert but create savings on future insert, search, or remove operations.

This issue will have "sub-issues" surrounding functions that will help implementation.

Abstract Tree's Data type

Add a layer of abstraction to tree's data type. Tree itself won't directly know what kind of data it's holding. Should achieve through additional structures and typedefs that can be changed in a central place and cascade across all tree functions.

Changeable input file

Professor will provide a few files inputXX.txt with the list of words. Need to be able to easily change between these files.

Output file parallels input file

Professor will provide inputXX.txt files and I can choose what goes in XX. Professor also gives expected output for each scenario in outputXX.txt

Need to create/update "myoutputXX.txt" file with the output of my program and I need to ensure that XX matches between the output and input files.

Binary search tree part

Assignment is to read words from a file and count them with a BST. This is part 2. Tree nodes will need to store a word and it's number of appearances.

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.