Tree Lab: Word count

17 Sep 2021 - 15:39 | Version 1 |

Learning Objective(s)

  1. Learn to code a binary tree and a binary search tree
  2. Improve understanding of cohesion and coupling
  3. Improve skill for developing test cases for best, average, worst situations

Overview of the problem

You need to do a word count on a text file. You must use a binary search tree to store the words.

Specifics

  • You may be case sensitive.
  • You can treat non characters and non white spaces as part of the word.
  • The filename should come from the command line (but this should be the very last thing you work on)

Design components

  • In your design decide if you will implement this with linked lists or an array. Justify your choice
  • Discuss possible best, worst, and average cases
  • Your tree should not know what is being stored in it.

Optional improvements

  • Make your code case insensitive.
  • Ignore non characters/non white spaces
  • Make the binary search tree an AVL tree
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback
This website is using cookies. More info. That's Fine