0% found this document useful (0 votes)
16 views5 pages

CS3353 Assignment 5 Fall 2024

Uploaded by

engrkumailabbas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views5 pages

CS3353 Assignment 5 Fall 2024

Uploaded by

engrkumailabbas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

CS3353: Data Structures and Algorithm Analysis I

Fall 2024

Homework #5

• Full name only: _____________________________________


• Release date: 5:15 PM, Oct 30, 2024 (Wednesday)
• Due date: 4:00 PM, Nov 13, 2024 (Wednesday)
• It should be done INDIVIDUALLY; Submit your source code and results through Canvas.
• Please refer to the course syllabus (Course Requirements and Grading Policy - Assignment, page 3)
for the policy of submission, late submission, missing submission, and wrong submission.
• Total: 20 pts
• Grading Policy for Mandatary Question
o Compilation error / run-time error:
 Deduct 5 pts first. Then TA needs to evaluate the program and apply the following grading
policy.
o Using programming languages other than Java and C++:
 Deduct 10 pts first. Then TA needs to evaluate the program and apply the above grading
policy.
o Submit multiple source code files: -3
o No homework submission: 0 pts
o Creating binary tree: 4 pts
 If the search results are incorrect, it’s likely that the tree structure is flawed. Then TA
needs to evaluate the program and deduct pts accordingly depending on the degrees of
wrongness.
o Breadth-First Traversal: 3 pts
 Correct output: 3 pts
 Wrong output:
• Partial points (e.g., 1 pt or 2 pts) are deducted depending on the degrees of
wrongness.
o Depth-First Traversal – preorder: 3 pts
 Correct output: receive 3 pts
 Wrong output: receive 1 pt
• Partial points (e.g., 1 pt or 2 pts) are deducted depending on the degrees of
wrongness.
o Depth-First Traversal – Inorder: 3 pts
 Correct output: receive 3 pts
 Wrong output: receive 1 pt
• Partial points (e.g., 1 pt or 2 pts) are deducted depending on the degrees of
wrongness.
o Depth-First Traversal – postorder: 3 pts
 Correct output: receive 3 pts
 Wrong output: receive 1 pt
• Partial points (e.g., 1 pt or 2 pts) are deducted depending on the degrees of
wrongness.
o Program menu as required: 1 pt
o Read data from the provided dataset: 1 pt
 Change the file name of dataset: -0.5
 Partial points (e.g., 0.5 pt) are deducted depending on the degrees of wrongness.
o Flexibility of changing the size of binary tree before “Traversal”: 1 pt
o Self-testing results: 1 pt
 No testing conducted / No WORD document: -0.5
 Submit photos instead of screenshots in WORD document: -0.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.

• Grading Policy for Extra/Bonus Question


o Compilation error / run-time error:
 Deduct 2 pts first. Then TA needs to evaluate the program and apply the following grading
policy.
o Using programming languages other than Java and C++:
 Deduct 3 pts first. Then TA needs to evaluate the program and apply the above grading
policy.
o Submit multiple source code files: -1
o No bonus question submission: 0 pts
o Three deletion operations (or scenarios): 3 pts
 No children: 1 pt
 One child: 1pt
 Two children: 1pt
• Correct output: 1 pt
• Wrong output:
o Partial points (e.g., 0.5) are deducted depending on the degrees of wrongness.
o Program menu as required: 0.5 pt
o Read data from the provided dataset: 0.5 pt
 Change the file name of dataset: -0.5
 No partial points (e.g., 0.5 pt) are given.
o Flexibility of changing the size of binary tree before “Deletion”: 0.5 pt
o Self-testing results: 0.5 pt
 No testing conducted / No WORD document / Submit photos instead of screenshots in
WORD document: -0.5
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 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.

/* Homework #5, James Bond */

• Your program should be menu-driven and execute the chosen command. If you type 6, then
exit the program.

M E N U

Create (0), Search (1), Breadth-First Traversal (2)


Depth-First Traversal: preorder (3), inorder (4), postorder (5)
Exit Program (6)

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

Create (0), Search (1), Breadth-First Traversal (2)


Depth-First Traversal: preorder (3), inorder (4), postorder (5)
Exit Program (6)

Choose? 0 15

M E N U

Create (0), Search (1), Breadth-First Traversal (2)


Depth-First Traversal: preorder (3), inorder (4), postorder (5)
Exit Program (6)

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

Create (0), Search (1), Breadth-First Traversal (2)


Depth-First Traversal: preorder (3), inorder (4), postorder (5)
Exit Program (6)

Choose? 1 200

There is no such node in the tree!

M E N U

Create (0), Search (1), Breadth-First Traversal (2)


Depth-First Traversal: preorder (3), inorder (4), postorder (5)
Exit Program (6)

Choose? 0 10

M E N U

Create (0), Search (1), Breadth-First Traversal (2)


Depth-First Traversal: preorder (3), inorder (4), postorder (5)
Exit Program (6)

Choose? 2

209 203 221 19 168 104 173 128 193 183

M E N U

Create (0), Search (1), Breadth-First Traversal (2)


Depth-First Traversal: preorder (3), inorder (4), postorder (5)
Exit Program (6)

Choose? 3

209 203 19 168 104 128 173 193 183 221

CS 3353: Data Structures and Algorithms Analysis I, Fall 2024 Copyright © 2024, Cong Pu
M E N U

Create (0), Search (1), Breadth-First Traversal (2)


Depth-First Traversal: preorder (3), inorder (4), postorder (5)
Exit Program (6)

Choose? 4

19 104 128 168 173 183 193 203 209 221

M E N U

Create (0), Search (1), Breadth-First Traversal (2)


Depth-First Traversal: preorder (3), inorder (4), postorder (5)
Exit Program (6)

Choose? 5

128 104 183 193 173 168 19 203 221 209

.
.
.

• 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

Create (0), Search (1), Breadth-First Traversal (2)


Depth-First Traversal: preorder (3), inorder (4), postorder (5)
Delete (6), Exit Program (7)

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

You might also like