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

Create 03 convertToRomanNumber.cpp #77

Merged
merged 1 commit into from
May 27, 2021

Conversation

Juro221
Copy link

@Juro221 Juro221 commented May 25, 2021

We create 2 helping arrays of size 13. One is filled with roman numbers and the second one is filled with arabic numbers representing those roman numbers in the first array. Then in a for and while cycle we are constructing our roman number and we are decreasing N. If N is zero we break out of cycle.
Time complexity is close to constant but it is not so time complexity is : O(log10 N)

We create 2 helping arrays of size 13. One is filled with roman numbers and the second one is filled with arabic numbers representing those roman numbers in the first array. Then in a for and while cycle we are constructing our roman number and we are decreasing N. If N is zero we break out of cycle.
Time complexity is close to constant but it is not so time complexity is : O(log10 N)
Copy link
Owner

@FazeelUsmani FazeelUsmani left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!!

@FazeelUsmani FazeelUsmani merged commit e6bfec4 into FazeelUsmani:master May 27, 2021
@FazeelUsmani FazeelUsmani linked an issue May 27, 2021 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

06 String --> 03 Convert to Roman number
3 participants