- Notifications
You must be signed in to change notification settings - Fork2.4k
Sri Hari: Batch-3/Neetcode-150/Added hints#3746
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Looks good, minor change requested
articles/task-scheduling.md Outdated
* Time complexity: $O(m)$ | ||
* Space complexity: $O(m)$ | ||
* Space complexity: $O(1)$ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Maybe i'm mistaken, but shouldn't the space complexity remain O(m)?
Oh, because the character set is 26. Can we add a note that this is because we only store a limited amount of values in the heap, like in:7a6051c
Someone asked me a question about this the other day so i thought it was worth clarifying.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The space complexity is O(1) because we store almost 26 elements only in any data structure.
It is a good idea to add that note. I will do that for all articles when I am adding the "Swift" code.
@neetcode-gh
Can you suggest the complexity for the problem "Design twitter", as it comes under heap category but the sorting solution also passes greatly for this problem?