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

Naheed Edges Palindrome #25

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

Naheed Edges Palindrome #25

wants to merge 1 commit into from

Conversation

arangn
Copy link

@arangn arangn commented Oct 17, 2018

No description provided.

i = 0
j = my_phrase.length - 1
while i < j do
until my_phrase[i] != " "

Choose a reason for hiding this comment

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

In the two nested inner loops, continue to check and confirm that i is less than j before comparing the character at the index i (or j) with a white space.

@shrutivanw
Copy link

Nice work! I added a minor comment to make your algorithm further robust.

I didn't see any comments on the time and space complexity. Think about what the time and space complexity of your algorithm would be. Friendly reminder: Always explain what n stands for while explaining your time and space complexity. That along with your explanation for reasoning behind your answer, is the complete answer for 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