i have thought a lot on this. but not getting O(n) solution. given n URL's and you have to find the unique URL in that (if there is any). you have to print that URL. thanks. O(n2) solution is a stupid solution, some O(n) is acheivable, but not getting how can it be O(n). i have lastly thoguht about tries. can it be like this ? some related to tries ? thanks alot in advance.
nitin1 15 Master Poster
Recommended Answers
Jump to PostYou need to think of a way that you only look at each entry in the list once, and at the end of it know the answer, or at least can find it very quickly.
How would you do this on paper? If I read out a list of words …
Jump to PostPerhaps we use different notations. I class O(n) and O(mn) and indeed O(any multiple of n at all) as all being O(n).
Jump to PostWhat happens when the growth of m reaches or exceeds the growth of n?
I took m to be a big constant, or at least something that would in practical terms be trusted not to exceed some definable constant.
All 10 Replies
Moschops 683 Practically a Master Poster Featured Poster
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
Moschops 683 Practically a Master Poster Featured Poster
nitin1 15 Master Poster
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
nitin1 15 Master Poster
Moschops 683 Practically a Master Poster Featured Poster
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
nitin1 15 Master Poster
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.