Skip to content

Solution #61 - Daniel/Edited - 13.03.2025 #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

danzang100
Copy link

Solution and Explanation added

@JRS296 JRS296 requested a review from SSexpl March 17, 2025 12:43
Copy link
Member

@JRS296 JRS296 left a comment

Choose a reason for hiding this comment

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

Make the requested changes

Comment on lines +1 to +8
Rotate a list by k elements.

Very straightforward by connecting tail node to the head.

Find k mod n rotations by moving the head pointer, and then finally disconnecting the tail from the current head.

Time Complexity: O(n)
Space Complexity: O(1)
Copy link
Member

Choose a reason for hiding this comment

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

Can be much better! Explain it as if you are explainaing this to a high school student. Also use markdown and try to explain the time and space complexity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants