1 / 12

Programming Assignment #5 Binary Trees

Programming Assignment #5 Binary Trees. CS-2301, System Programming for Non-Majors (Slides include materials from The C Programming Language , 2 nd edition, by Kernighan and Ritchie and from C: How to Program , 5 th and 6 th editions, by Deitel and Deitel). Assignment.

shima
Download Presentation

Programming Assignment #5 Binary Trees

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Programming Assignment #5Binary Trees CS-2301, System Programmingfor Non-Majors (Slides include materials from The C Programming Language, 2nd edition, by Kernighan and Ritchie and from C: How to Program, 5th and 6th editions, by Deitel and Deitel) Binary Trees

  2. Assignment • Read in a series of text files • Keep track of the number of occurrences of each word • In the set of files you read • Print out a list of words (in alphabetical order) and the number of times each occurs Due Date:– Friday, December 4, 2009, 11:59 PM Binary Trees

  3. Goals and Objectives • Pull together a non-trivial program from resources and algorithms at your disposal • Build up and use a massive data structure in the form of a binary tree • One entry for each separate word encountered • Each entry counts the number of instances of that word • Create and write your output file Binary Trees

  4. By the End of this Assignment… • … you should start feeling confident that • You can write a non-trivial C program for any course assignment at WPI • You are capable of learning the things you don’t know on your own • You are beginning to think “computationally” with respect to collecting and organizing data Binary Trees

  5. What is a Binary Tree? • Previous lecture topic • See also §6.5 of Kernighan & Ritchie Binary Trees

  6. Even Wikipedia! Even your friends! Your Program • Multiple files as in previous programming assignments • Of your own organization • makefile to build it or • Visual Studio • Algorithms from K & R or any other resources • Cite your resources! Binary Trees

  7. Command Line of Your Program ./PA5 outputFile inputFile1 inputFile2 ... Binary Trees

  8. Sample Output(written to outputFile) 166 a 25 and 11 as 3 command 15 each 2 file 4 files 109 in 4 input 98 it 99 of 3 open 6 program 18 read 152 the 41 this 3 under 30 would------------- 17 Total number of different words Binary Trees

  9. Five points extra credit. To be introduced in Lab #6 on December 2. You will need to learn how to provide command line arguments to your program! makefile or Visual Studio • For building your program • Note:– we don’t know what the file names of your program components are • Only you (and your makefile) know what needs to be built and how • If you are feeling adventurous • Build and debug in Visual Studio instead • Use Visual Studio project files • Clean your project before submitting • Zip your files together for submission Binary Trees

  10. Write-up • Description of your program, the .c files, .h files, etc. • Pre- and post-conditions of all recursive functions • Loop invariants of critical loops • Description of your data structure and the principal functions • Citation of resources and algorithms Binary Trees

  11. Submitting Your Project • Use /cs/bin/turnin submit cs2301 PA5 ... • Submit:– • Write-up • .c files, .h files, and makefile or • Clean, zipped version of Visual Studio project directory • Sample output Binary Trees

  12. Questions? Binary Trees

More Related