Skip to content

Conversation

pull[bot]
Copy link

@pull pull bot commented Sep 22, 2022

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

itsAkshayDubey and others added 4 commits September 22, 2022 17:18
* feat: Add square free integer implementation

* test: Add unit tests for square free integer

* refactor: Remove trailing whitespace from line 27

* refactor: Fix comments
* feat: Added Algo first unique char in a string.

* Optimised algo to linear time complexity

* removed double quotes

* Review changes: if-else logic
* Refactored RotatedListRight.js and added its tests

* rotateListRight test and improved implementation

* Review changes on constructor's loop
* Bugfix AVLTree comparator

The original insertBalance function was doing raw value comparisons as opposed to using the tree's comparator. This is clearly unintentional, and would (ultimately) cause the structure to segfault when constructed with the stringData included in the updated test.

I've added the fix, scanned the rest of the code for similar issues, and added the appropriate test case which passes successfully with the fix. The jest code coverage increases slightly as well with the changes.

* 100% jest code coverage

Added a couple of extra elements to the original test tree, and then removed elements in an order such that all previously uncovered branches of code are now covered.

Also added an emptyTree structure to test some additional (trivial) base cases.

* standard style fix

missed this from my previous commit

* Iterative & in-place BFS

An iterative analog to the traditional recursive breadth-first-search algorithm for binary trees.

This in-place solution uses the pre-existing "traversal" array for both tracking the algorithm as well as storing the result.

Also tweaked old code by resetting the traversal array each time the tree is traversed (otherwise you're only allowed to traverse a tree once which doesn't seem correct even with a single traversal function).

* Update BreadthFirstTreeTraversal.js

got rid of unnecessary currentSize
added currentNode for clarity
@pull pull bot added the ⤵️ pull label Sep 22, 2022
@pull pull bot merged commit 7ab9792 into AlgorithmAndLeetCode:master Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants