yaar i can think of only 2 methods for this
1. O(nlogn) o(n) sol
traverse the heap...and hash the elements..if it exist then delete it
2.make another heap but transfering elements from 1st to 2nd heap...if the
element is equal to the last inserted element then discard it
--
You received
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view this discussion on the web visit
https://groups.google.com/d/msg/algogeeks/-/lZRdyZn85fcJ.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this
guys do we have algo to remove duplicates in o(n) time and in spce
comepexity 0(1)...in unsorted...array or string.???
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To
1. remove duplicates from array when it is sorted..o(n)tym and o(1)
space..
2. remove duplicates from array when it is not sorted..o(n)tym and o(1)
space..
i can tget these from archives...if anybody earlier asked then plz post me
the link of thtaif not then rovide me with sol of