interview-corner icon indicating copy to clipboard operation
interview-corner copied to clipboard

One Dimensional Array -> First Missing Integer : Add C++ optimisation; and fix some bugs

Open SamrendraS opened this issue 4 years ago • 2 comments
trafficstars

Hello @Abhijit2505 ! I am Samrendra, a Participant of SWOC'21. I have found a few issues on the page - First Missing Integer in the section One Dimensional Array and would like to work on them. Link to the page - https://abhijit2505.github.io/Algorithmic-Treasure-Site/Pages/Array/firstMissingInt.html

Following are the issues: 1. The current C++ code sorts the vector using stl::sort(); this has an amortized time complexity of O(nlogn), but the given algorithm is wrongly marked as an O(n) time complexity. This needs to be corrected. image 2. The current C++ code can be further optimised to reach the required O(n) time and O(1) space complexity by using swapping of elements. I would like to provide that code too. 3. There is no explanation of test cases provided. I would like to provide explained sample input and sample output.

Please assign this issue to me, would like to work on them.

SamrendraS avatar Jan 07 '21 14:01 SamrendraS

@SamrendraS please get started

Abhijit2505 avatar Jan 17 '21 08:01 Abhijit2505

@Abhijit2505 Please accept PR 71 https://github.com/Abhijit2505/Algorithmic-Treasure-Original/pull/71

SamrendraS avatar Jan 23 '21 09:01 SamrendraS