Code Monkey home page Code Monkey logo

wordtreestats's Introduction

wordtreestats

This was one of my early C++ programs I have written. The goal was to implement a balance binary tree structure (Red Black tree) and demonstrated it. This program when executed accepts an argument for specifying a filename for it to process. It will retrieve all the words in the file and adds them in the tree sorted. It will then provide results of all the words sorted and the number of occurrences and tree processing stats. The results will be stored in a file called results.out.

An example:

C:>wordtreestats input.txt
Results stored within result.out.

result.out:

List of sorted distinct words and their # of occurrences:

A 18
ABSTRACTS 2
ACP 1
AFGI 1
ANNOUNCEMENT 1
ASCII 1
Aarhus 2
Abelian 3
Abstraction 1
Accept 1

...........

1441 - distinct words
4492 - word duplicates
13 - normal tree height
7 - black tree height
461 - left tree rotations performed
449 - right rotations performed

wordtreestats's People

Contributors

frankgiordano avatar

Watchers

James Cloos avatar  avatar

wordtreestats's Issues

Revisit code and perform some tweaks.

1 - "Results stored within result.txt." is incorrect needs to say results.out.

2 - reformat code and do some clean up.

3 - Change the output format.

4 - Remove some verbose statements end user wont need to see.

5 - Add file read error handling.

6 - Allow end user to specify input file.

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.