CS3353 Assignment 5 Fall 2024
CS3353 Assignment 5 Fall 2024
Fall 2024
Homework #5
CS 3353: Data Structures and Algorithms Analysis I, Fall 2024 Copyright © 2024, Cong Pu
o Students will not receive 0 pts if students spend time and effort on program and make the
submission.
If the program has issues/problems, TA needs to evaluate student’s program and gives
partial points depending on the quality/completion of program.
o To meet course objectives and students learning outcomes (Page 1, course syllabus), students
are required to use the data structure(s) and/algorithm(s) introduced/learned in the class to
solve the homework question(s).
If students choose not to use the data structure(s) and/algorithm(s) introduced/learned in
the class, deduct 5 pts first. Then TA needs to evaluate the program and apply the above
grading policy.
The policy addresses the general topics introduced in class. It is up to the students to
decide how they wish to practice (specific implementations) these general topics. The
general topics and their specific implementations are distinct. As an instructor, I focus on
the general topics that are used for learning outcomes and student performance evaluation.
o The instructor will decide the grade policy of any scenario which is not covered by the above
list. Meanwhile, please kindly contact the instructor if you have any questions regarding the
grading policy.
CS 3353: Data Structures and Algorithms Analysis I, Fall 2024 Copyright © 2024, Cong Pu
1. Write a program to build a binary tree from the 1st part of IP addresses (the digit(s) before the first dot
(.) in the IP addresses (1st field in the Apache logs); See the example below.) in the UPDATED Apache
logs (filename: Apache_Logs_UPDATED.txt).
The user will specify the size of the binary tree by entering an integer value between 10 and 30. This
integer represents the number of IP addresses (1st part) that your program should read from the
UPDATED Apache logs (filename: Apache_Logs_UPDATED.txt). The user can change the size of the
binary tree by entering a new value between 10 and 30. The program should accommodate changes
before search and traversal. Once the tree is constructed, conduct search and tree traversal functions
including breadth-first traversal and depth-first traversal (preorder, inorder, and postorder). Search and
tree traversal functions are applied to the most recently constructed tree. Here is a set of requirements to
follow:
• Type the homework number and your full name at the top in your source code.
• Your program should be menu-driven and execute the chosen command. If you type 6, then
exit the program.
M E N U
Choose?
• Display a message, in case when searching a node that does not exist in the tree.
• Show ALL your work. For example,
M E N U
Choose? 0 15
M E N U
Choose? 0 18
(Note: The user changed the size of binary tree via entering a
new value. The program should be flexible with change before
search and traversal.)
CS 3353: Data Structures and Algorithms Analysis I, Fall 2024 Copyright © 2024, Cong Pu
M E N U
Choose? 1 200
M E N U
Choose? 0 10
M E N U
Choose? 2
M E N U
Choose? 3
CS 3353: Data Structures and Algorithms Analysis I, Fall 2024 Copyright © 2024, Cong Pu
M E N U
Choose? 4
M E N U
Choose? 5
.
.
.
• Please refer lecture slides and source code/pseudocode for creating binary tree from starch,
Breadth-First Traversal, and Depth-First Traversal.
• Submit your source code and self-testing results (e.g., readable and clear screenshots) through
Canvas before the due date, 4:00 PM, Nov 13, 2024 (Wednesday). TA will build and run
your source code and test with random input.
• Source code (one file only) – The file name should be “your name + homework number”,
e.g., james_bond_5.cpp or james_bond_5.java.
• Self-testing Results (e.g., readable and clear screenshots) in WORD document.
• You do not need to submit the UPDATED Apache logs file.
2. [Extra/Bonus Credit] If you can implement a delete operation, extra 5 points will be provided. The
program should deal with three deletion cases: no children, one child, and two children. Your menu
should be shown below,
M E N U
Choose?
.
.
.
• Submit your source code and self-testing results (e.g., readable and clear screenshots) of bonus
program through Canvas before the due date, 4:00 PM, Nov 13, 2024 (Wednesday). TA will
build and run your source code and test with random input.
• Source code (one file only) – The file name should be “your name + homework number”,
e.g., james_bond_5_bous.cpp or james_bond_5_bous.java.
• Self-testing Results (e.g., readable and clear screenshots) in WORD document.
• You do not need to submit the UPDATED Apache logs file.
CS 3353: Data Structures and Algorithms Analysis I, Fall 2024 Copyright © 2024, Cong Pu