yes for integer arrays we need to sort o(nlogn) and den compare in o(n) On Sat, Sep 10, 2011 at 7:12 PM, Ishan Aggarwal < ishan.aggarwal.1...@gmail.com> wrote:
> Hi, > > Actually I am not good at hash tables. can u plzz suggest me some gud link > from where I can study hash tables... > and also tell me the logic for integer arrays for which the complexity will > be o(n logn). > > Thanks in advance. > > > -- > Kind Regards > Ishan Aggarwal > Phone : +91-9654602663 > > > On Sat, Sep 10, 2011 at 7:03 PM, Brijesh <brijeshupadhyay...@gmail.com>wrote: > >> If you are talking about character array then it can be done in space >> O(128)=constant and time O(n),,. as Use Hash table of all 128 characters , >> and then traverse through your array and mark a flag in the hash table..when >> you encounter any duplicate character , which would be marked already in the >> hash table , dont print it..! >> >> And if its integer array... best would be sort it in O(n logn) and >> traverse through the loop and print those numbers which are not same as >> previous number.. >> >> On Saturday, 10 September 2011 14:51:18 UTC+5:30, Ishan Aggarwal wrote: >> >>> Write a program to remove duplicate elements from an array by printing >>> them only once? >>> >>> What will be the minimum time and space complexity required for this >>> program? >>> >>> -- >>> Kind Regards >>> Ishan Aggarwal >>> [image: Aricent Group] >>> Presidency Tower-A, M.G.Road,Sector-14 >>> Gurgaon,Haryana.122015 INDIA >>> Phone : +91-9654602663 >>> ishan2....@aricent.com >>> >>> -- >> 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/-/TqJhP_DAD2AJ. >> >> To post to this group, send email to algogeeks@googlegroups.com. >> To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > > > -- > 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 unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- 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 unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.