forked from keon/algorithms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixes code for linkedlist/copy_random_pointer - Fixes the code (was previously commented) by uncommenting it and implementing the missing class that was referenced - Creates 2 test cases for both solutions in the code * Fix tests for arrays/plus_one - There was an issue while trying to access an index in a for loop within the array package (plus_one_v3() function) - idx was a tuple since it was being created as an enumerate(list) but it was being used as a simple index to access the list. - Changes the idx to access the element of the tuple that is the actual index (not the value) * Reformat linkedlist copy_random_pointer - Remove classes. Now there are 2 versions of the same function - Remove tests. - Move tests to the tests directory. Since the structure of this node is slightly different (adding an atribute) there is a helper inner function that will create the nodes in the structure for the 2 tests that were added. * Unify name of functions in copy_random_pointer.py
- Loading branch information
Showing
4 changed files
with
88 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters