egeldenhuys / black-fitch

[DEPRECATED] Black-box Unit Tests for Fitchfork practicals and assignments
GNU General Public License v3.0
8 stars 4 forks source link

Started adding task 1. #51

Closed Quantum-Sicarius closed 7 years ago

Quantum-Sicarius commented 7 years ago
Quantum-Sicarius commented 7 years ago

Currently stuck at getting 14 for the FitchFork results.

Success: Inserting

Success: Right threads

Success: Left threads

Success: Insert, large tree
Success: Right threads, large tree
Success: Left threads, large tree

Success: No duplicates allowed
Success: contains() method

Success: inorderAscending() traversal
Success: inorderDescending() traversal

Failure: delete root
Failure: delete non-root
Failure: delete non-existent node

Success: countRightThreads()
Success: countLeftThreads()
Success: getNumberOfNodes()
Success: getHeight()

Failure: delete from a clone tree

As you can see deletion is incorrect for some reason. Could be due to me not understanding how they want it to be done. Currently the test is going one right then going as far left as possible (Smallest number.) It could be that they want the opposite: the biggest number. @egeldenhuys If you could test and check back.

I am going to start working on Task 2.

Quantum-Sicarius commented 7 years ago

Assuming this tree: image Deleting 2 and 8 should result if I have it correctly: image

You have to implement the mirror case of delete by merging
as discussed in the textbook. That is, for a deleted node,
its right child should replace it in the tree and not its
left child as in the textbook examples. Relevant left and
right threads must be updated accordingly.

I am really confused.

egeldenhuys commented 7 years ago

@Quantum-Sicarius I am working on implementing and testing my delete function. I will compare with your tests and give feedback