Re: [algogeeks] smallest segment in a document containing all the given words

2011-12-02 Thread surender sanke
Hi how about finding this for an integer array and finding i and j such that Min(j-i) surender On Fri, Dec 2, 2011 at 3:09 AM, sravanreddy001 sravanreddy...@gmail.comwrote: An idea is to start with a heap of size k. Its tricky how to keep track of the start and end indices of the smallest

Re: [algogeeks] Link list Q

2011-12-02 Thread Vijay Khandar
Thanks. I got it... On Fri, Dec 2, 2011 at 12:30 PM, atul anand atul.87fri...@gmail.com wrote: simple way of understanding this algo is that , q is incremented twice than p or you can say q is moving twice faster then p. consider a scenario where last_node- = first_node. now q would

Re: [algogeeks] Removing Duplicates In array and Linked list

2011-12-02 Thread kumar raja
@Karthikeyan: I want linear time solution not nlogn On 1 December 2011 23:42, Karthikeyan V.B kartmu...@gmail.com wrote: Hi, Create a binary search tree with elements , while inserting check for equal elements and delete it. But for insertion of n elements in a BST takes O(nlogn) --

[algogeeks] Re: smallest segment in a document containing all the given words

2011-12-02 Thread vikas
parse the document for the words and maintain a position table position table should be like this: w1- p1 p2 p3pn w2-x1 x2 x3 xn k lists O(n) if hashing is used now go to begining of list and findout the maximum position say 'start' O(k) similarly from end of all list , check for the

[algogeeks] Re: Removing Duplicates In array and Linked list

2011-12-02 Thread Dave
@Kumar: What makes you think that there is an O(n) time, O(1) space algorithm? Dave On Dec 2, 6:26 am, kumar raja rajkumar.cs...@gmail.com wrote: @Karthikeyan: I want linear time solution not nlogn On 1 December 2011 23:42, Karthikeyan V.B kartmu...@gmail.com wrote: Hi, Create a

[algogeeks] Re: smallest segment in a document containing all the given words

2011-12-02 Thread Dave
@Sravanreddy: Filling in a few details: Find the first occurrence of each given word in the document. While doing this, insert the location of each word into a min-heap, and keep track of the maximum of all locations. Record the difference between the top of the heap and the maximum as the

[algogeeks] Thanks To aLgOgEeKs

2011-12-02 Thread VIHARRI
Hi, I got selected in Microsoft yesterday. Thanks to all the geeks and the group, especially to managers!!! My concept regarding the logic for Algorithms and how the tackle a new problem have been improved after seeing many post and solutions from different people, so that credit goes to this

Re: [algogeeks] Thanks To aLgOgEeKs

2011-12-02 Thread atul anand
congrats :) :) On Fri, Dec 2, 2011 at 8:39 PM, VIHARRI viharri@gmail.com wrote: Hi, I got selected in Microsoft yesterday. Thanks to all the geeks and the group, especially to managers!!! My concept regarding the logic for Algorithms and how the tackle a new problem have been improved

Re: [algogeeks] Thanks To aLgOgEeKs

2011-12-02 Thread Karthikeyan V.B
Congratulations:) -- 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

Re: [algogeeks] Thanks To aLgOgEeKs

2011-12-02 Thread rahul sharma
gr8...congrats dude On Fri, Dec 2, 2011 at 9:05 PM, Karthikeyan V.B kartmu...@gmail.com wrote: Congratulations:) -- 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

Re: [algogeeks] Thanks To aLgOgEeKs

2011-12-02 Thread rahul sharma
plz post how you prepared for MS..like the books or websites you followedwould b of gr8 help. On Fri, Dec 2, 2011 at 9:42 PM, rahul sharma rahul23111...@gmail.comwrote: gr8...congrats dude On Fri, Dec 2, 2011 at 9:05 PM, Karthikeyan V.B kartmu...@gmail.comwrote: Congratulations:)

Re: [algogeeks] Thanks To aLgOgEeKs

2011-12-02 Thread payal gupta
congrats..:):) plzz...elaborate the last two problemsand it vud be very grateful if u tell their solns tooo... Regards, payal gupta, cse,3rd year, nit-b. On 12/2/11, rahul sharma rahul23111...@gmail.com wrote: plz post how you prepared for MS..like the books or websites you

[algogeeks] Re: Interview question

2011-12-02 Thread Don
(!x || !(x^1)) !(x1) !((x|1)-1) (x*x)==x (x==(x==x))||(x==(x!=x)) etc. On Nov 29, 9:07 pm, Nitin Garg nitin.garg.i...@gmail.com wrote: *What are the different ways to say, the value of x can be either a 0 or a 1.* -- Nitin Garg Personality can open doors, but only Character can keep them

[algogeeks] Backtracking algorithm for binpacking-like problem

2011-12-02 Thread Ania
Hi, Here is my problem: I have a list of items (only positive integers are allowed) and fixed number of bins of identical capacity. I need to pack items (if possible) so that elements in each bin sum up to given capacity. So far I implemented recursive algorithm but I try to convert my recursive