Skip to content
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

Anibel - Integer Palindrome Check - Edges #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

anibelamerica
Copy link

The time complexity for this implementation of an integer palindrome check is linear or O(n) where n is equal to the number of place values of the input number argument. In this implementation, a copy of the number is saved and then reversed. At the earliest (aside from edge or basic scenarios of a nil, 0 <= number < 10, negative input), n/2 comparisons could be made before confirming an integer palindrome. Otherwise, the program will run n comparisons before completion.

The space complexity for this program is O(1) or constant since it will always track 2 variables (integers) for the duration of the program.

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.

1 participant