Skip to content

Conversation

@enqidu
Copy link
Contributor

@enqidu enqidu commented Jul 7, 2020

Description of Change

Checklist

  • Added description of change
  • Added file name matches File name guidelines
  • Added tests and example, test must pass
  • PR title follows semantic commit guidelines
  • I acknowledge that all my contributions will be made under the project's license.

Notes:
Skip List is very useful data structure for searching in sparse and big data.

@lgtm-com
Copy link

lgtm-com bot commented Jul 7, 2020

This pull request introduces 1 alert when merging f13964c into 5baf1ad - view on LGTM.com

new alerts:

  • 1 for Resource not released in destructor
@enqidu
Copy link
Contributor Author

enqidu commented Jul 7, 2020

Can someone tell me why is it failing?

@lgtm-com
Copy link

lgtm-com bot commented Jul 7, 2020

This pull request introduces 1 alert when merging 2fb95a2 into 5baf1ad - view on LGTM.com

new alerts:

  • 1 for Resource not released in destructor
@kvedala
Copy link
Collaborator

kvedala commented Jul 7, 2020

Can someone tell me why is it failing?

Please click on details and you'll find the descriptions for exactly why the tests are failing.
Screenshot_20200707-064056

@enqidu
Copy link
Contributor Author

enqidu commented Jul 7, 2020

Can someone tell me why is it failing?

Please click on details and you'll find the descriptions for exactly why the tests are failing.
Screenshot_20200707-064056

thanks

@lgtm-com
Copy link

lgtm-com bot commented Jul 7, 2020

This pull request introduces 1 alert when merging 910180f into 5baf1ad - view on LGTM.com

new alerts:

  • 1 for Resource not released in destructor
@enqidu
Copy link
Contributor Author

enqidu commented Jul 7, 2020

@kvedala I have this error "Consider using rand_r(...) instead of rand(...) for improved thread safety", but when I switch to rand_r windows tests fail (even though I include #include library). Could you tell me how can I resolve this?

@lgtm-com
Copy link

lgtm-com bot commented Jul 7, 2020

This pull request introduces 1 alert when merging 8e99383 into 5baf1ad - view on LGTM.com

new alerts:

  • 1 for Resource not released in destructor
@kvedala
Copy link
Collaborator

kvedala commented Jul 7, 2020

@kvedala I have this error "Consider using rand_r(...) instead of rand(...) for improved thread safety", but when I switch to rand_r windows tests fail (even though I include #include library). Could you tell me how can I resolve this?

  1. Much of the code uses C header files and C functions. If you want to continue using them, the code will be more appropriate for the https://github.com/TheAlgorithms/C repo.
  2. For C++, the correct way to invoke randr function is: std::randr. Moreover, before invoking the rand function, the generator needs to be initialized: std::srand(std::time(nullptr)).
  3. Following C++ standards should help you get closer to overcoming the errors and alerts reported by the auto-checks.

For more info, please refer to existing code in the repo for reference. There are many programs that use the above functions and should help you learn how to best use them.

Let me also give you a heads up about the documentation standards - we use Doxygen to autogenerate the website - https://thealgorithms.github.io/C-Plus-Plus

@kvedala
Copy link
Collaborator

kvedala commented Jul 7, 2020

Please also enable GitHub Actions in your fork so that the auto tools can help auto-format the code for you

@enqidu
Copy link
Contributor Author

enqidu commented Jul 7, 2020

@kvedala I have this error "Consider using rand_r(...) instead of rand(...) for improved thread safety", but when I switch to rand_r windows tests fail (even though I include #include library). Could you tell me how can I resolve this?

  1. Much of the code uses C header files and C functions. If you want to continue using them, the code will be more appropriate for the https://github.com/TheAlgorithms/C repo.
  2. For C++, the correct way to invoke randr function is: std::randr. Moreover, before invoking the rand function, the generator needs to be initialized: std::srand(std::time(nullptr)).
  3. Following C++ standards should help you get closer to overcoming the errors and alerts reported by the auto-checks.

For more info, please refer to existing code in the repo for reference. There are many programs that use the above functions and should help you learn how to best use them.

Let me also give you a heads up about the documentation standards - we use Doxygen to autogenerate the website - https://thealgorithms.github.io/C-Plus-Plus

Thank you, I've polished code following C++ standards

@lgtm-com
Copy link

lgtm-com bot commented Jul 7, 2020

This pull request introduces 1 alert when merging 5068ddc into 5baf1ad - view on LGTM.com

new alerts:

  • 1 for Resource not released in destructor
@kvedala
Copy link
Collaborator

kvedala commented Jul 7, 2020

This pull request introduces 1 alert when merging 5068ddc into 5baf1ad - view on LGTM.com

new alerts:

  • 1 for Resource not released in destructor

☝️

Copy link
Collaborator

@kvedala kvedala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from the suggested changes and possible sources of errors, the code lacks proper memory management.
Execution leads to segmentation faults as shown in the screenshot. Please re-assess the code and try to address the concerns.

Thank you for your contribution. Looking to see the corrections and a working code.
Screen Shot 2020-07-07 at 9 36 09 AM

enqidu and others added 3 commits July 10, 2020 21:27
Co-authored-by: Krishna Vedala <7001608+kvedala@users.noreply.github.com>
Co-authored-by: Krishna Vedala <7001608+kvedala@users.noreply.github.com>
Co-authored-by: Krishna Vedala <7001608+kvedala@users.noreply.github.com>
@enqidu
Copy link
Contributor Author

enqidu commented Jul 11, 2020

Hello, @kvedala I merged commits as you told me.

void* value;
// Forward Array points to the neighbour (right)
// nodes of the given one in all levels
vector<Node*> forward;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Class variables still not commented correctly. Please refer the following

@kvedala
Copy link
Collaborator

kvedala commented Jul 11, 2020

Thank you. Much has been resolved. Just the class member variables are not documented per standard.

@kvedala
Copy link
Collaborator

kvedala commented Jul 11, 2020

Screen Shot 2020-07-11 at 6 41 19 PM
Note:

  1. The formatter is trying to apply some fixes. Please enable "GitHub Actions" on your fork
  2. Better to use std::unique_ptr where possible. I have disabled this as an error but is a good CPP Standard Recommendation
@kvedala
Copy link
Collaborator

kvedala commented Jul 12, 2020

Doc fixes look good 👍
Self tests are failing

@enqidu
Copy link
Contributor Author

enqidu commented Jul 12, 2020

Doc fixes look good
Self tests are failing

Yeah, I have no idea why, I just changed comments

@kvedala
Copy link
Collaborator

kvedala commented Jul 12, 2020

Doc fixes look good
Self tests are failing

Yeah, I have no idea why, I just changed comments

We recently added stricter checks on the code submitted (see #947)

@enqidu
Copy link
Contributor Author

enqidu commented Jul 12, 2020

Doc fixes look good
Self tests are failing

Yeah, I have no idea why, I just changed comments

We recently added stricter checks on the code submitted (see #947)

Sorry. I can't work on this any longer.

@kvedala
Copy link
Collaborator

kvedala commented Jul 12, 2020

Doc fixes look good
Self tests are failing

Yeah, I have no idea why, I just changed comments

We recently added stricter checks on the code submitted (see #947)

Sorry. I can't work on this any longer.

Thank you for your tries and contribution, I'll for it to my branch and fix it further by myself. Your commits will retain your history so that you get due credit for your work.

@kvedala
Copy link
Collaborator

kvedala commented Jul 12, 2020

image

Is this the expected output?

@enqidu
Copy link
Contributor Author

enqidu commented Jul 13, 2020

image

Is this the expected output?

Yes. Numbers are randomized so every execution will give different output but list display shows us that it's working.

@enqidu
Copy link
Contributor Author

enqidu commented Jul 13, 2020

Doc fixes look good
Self tests are failing

Yeah, I have no idea why, I just changed comments

We recently added stricter checks on the code submitted (see #947)

Sorry. I can't work on this any longer.

Thank you for your tries and contribution, I'll for it to my branch and fix it further by myself. Your commits will retain your history so that you get due credit for your work.

Okay. Good luck

@kvedala kvedala requested a review from ayaankhan98 July 13, 2020 12:06
Copy link
Member

@ayaankhan98 ayaankhan98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ayaankhan98 ayaankhan98 merged commit ef13806 into TheAlgorithms:master Jul 13, 2020
@kvedala kvedala linked an issue Jul 13, 2020 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants