Re: [algogeeks] Re: amazon interview questions

2012-06-05 Thread Ashish Goel
*tree   substrings*

tree--|---mississippim .. mississippi
   |
   |---i--|---ssi--|---ssippi   i .. ississippi
   |   | |
   |   | |---ppi  issip,issipp,issippi
   |   |
   |   |---ppiip, ipp, ippi
   |
   |---s--|---si--|---ssippis .. ssissippi
   |   ||
   |   ||---ppi   ssip, ssipp, ssippi
   |   |
   |   |---i--|---ssippi si .. sissippi
   |   |
   |   |---ppisip, sipp, sippi
   |
   |---p--|---pi p, pp, ppi
   |
   |---i  p, pi

*--- Suffix Tree for mississippi ---*
in this example, any bifurcation implies that the substring is repeated(eg
i, s, ss, si, p, issi) and looks like this problem can be done while
forming the suffix trie

Best Regards
Ashish Goel
Think positive and find fuel in failure
+919985813081
+919966006652


On Tue, Jun 5, 2012 at 12:28 AM, Abhishek Sharma abhi120...@gmail.comwrote:

 I think it can be done by modifying the h-array and by making some changes
 in KMP-algorithm


 On Mon, Jun 4, 2012 at 9:35 AM, Jeevitesh jeeviteshshekha...@gmail.comwrote:

 i have not implemented it but i can you an idea how to approach it.

 Go to Each suffix in suffix or suffix array(I would prefer suffix array
 as it is easier) traverse the each suffix till you encounter the first
 letter of the suffix you are traversing and check to see this suppose i is
 the index you found out the starting letter then check
 s.substring(0,i)==s.substring(i,2i).

 I hope you get the idea.


 On Mon, Jun 4, 2012 at 9:14 AM, utsav sharma utsav.sharm...@gmail.comwrote:

 @jeevitesh :- yes i am also thinking of suffix tree,
  but i am facing problem in implementing it. did you implement it ??


 On Mon, Jun 4, 2012 at 9:11 AM, utsav sharma 
 utsav.sharm...@gmail.comwrote:

 @hassan :- it will not work for many strings as you are checking from
 the mid of strings. try out ababcdef,aabc.
 @atul :- it should be done in O(n).


 On Sun, Jun 3, 2012 at 11:54 PM, Hassan Monfared 
 hmonfa...@gmail.comwrote:

 yes it's not valid


 On Sun, Jun 3, 2012 at 5:36 PM, anugrah anugrah.agra...@gmail.comwrote:

 So any string with two same characters is not valid??

 for example :

 GEEK has E followed by E.

 So GEEK is also invalid?

 On Jun 3, 1:49 pm, Hassan Monfared hmonfa...@gmail.com wrote:
  bool IsValid(string s)
  {
   for(int len=0;lens.len/2;len++)
   {
 int start1=0,start2=len+1;
 while(start2s.size())
 {
for(int i=0;ilen  start2+is.size() 
  s[start1+i]=s[start2+i];i++);
if(i==len)
 return false; //not valid
start1++;
start2++;
  }
   }
  return true; // valid
 
 
 
 
 
 
 
  }
  On Sun, Jun 3, 2012 at 12:52 PM, atul anand 
 atul.87fri...@gmail.com wrote:
   can be done with O(n^2) time complexity..
 
   can it be done with O(n) complexity ???
 
   On 6/3/12, utsav sharma utsav.sharm...@gmail.com wrote:
given a string tell wether it is valid or not.
string is valid if there is no substring which have the same
 substring
following it.
 
these strings are not valid:- stringstring,geek123123rt,
abcadabcad,strngstingstrngsting
 
--
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.

 --
 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.



  --
 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] importance of heaps

2012-06-05 Thread Abhishek Sharma
can anyone please tell me how important are heaps as compared to other data
structures (from interview's point of view). i am not talking about simple
min/max heaps, but advanced ones like fibonacci heaps and binomial heaps

-- 
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.



[algogeeks] implementation of dijkstra

2012-06-05 Thread Abhishek Sharma
how to implement dijkstra algorithm using fibonacci heaps ?thanks in
advance

-- 
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.



Re: [algogeeks] Re: amazon interview questions

2012-06-05 Thread Ashish Goel
Hassan, can you explain your algo?
Best Regards
Ashish Goel
Think positive and find fuel in failure
+919985813081
+919966006652


On Mon, Jun 4, 2012 at 11:20 AM, Hassan Monfared hmonfa...@gmail.comwrote:

 for

-- 
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.



Re: [algogeeks] Re: amazon interview questions

2012-06-05 Thread Ashish Goel
The problem suggests that a character can't be more than once present and
thereby it can be done by just having s bitmap and if a char repeats, any
longer repeating substring will have those char repeated atleast twice,
hence O(n) solution.


Also, Hasaan: how is your algo O(n2) for for-while-for chain?

Best Regards
Ashish Goel
Think positive and find fuel in failure
+919985813081
+919966006652


On Tue, Jun 5, 2012 at 11:42 AM, Ashish Goel ashg...@gmail.com wrote:

 Hassan, can you explain your algo?

 Best Regards
 Ashish Goel
 Think positive and find fuel in failure
 +919985813081
 +919966006652


 On Mon, Jun 4, 2012 at 11:20 AM, Hassan Monfared hmonfa...@gmail.comwrote:

 for




-- 
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.



Re: [algogeeks] Re: amazon interview questions

2012-06-05 Thread Hassan Monfared
Ashish:

the algorithm passes over string and check if there is any substring with
len=1 is repeated or not. if not, tries for substring with len 2,... and so
on.
max length of substring which can be repeated can be at most  N/2.


Regards,


On Tue, Jun 5, 2012 at 10:48 AM, Ashish Goel ashg...@gmail.com wrote:

 The problem suggests that a character can't be more than once present and
 thereby it can be done by just having s bitmap and if a char repeats, any
 longer repeating substring will have those char repeated atleast twice,
 hence O(n) solution.


 Also, Hasaan: how is your algo O(n2) for for-while-for chain?

 Best Regards
 Ashish Goel
 Think positive and find fuel in failure
 +919985813081
 +919966006652


 On Tue, Jun 5, 2012 at 11:42 AM, Ashish Goel ashg...@gmail.com wrote:

 Hassan, can you explain your algo?

 Best Regards
 Ashish Goel
 Think positive and find fuel in failure
 +919985813081
 +919966006652


 On Mon, Jun 4, 2012 at 11:20 AM, Hassan Monfared hmonfa...@gmail.comwrote:

 for



  --
 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.



[algogeeks] want to create a table of words having 2 columns seperate for name and surname

2012-06-05 Thread daksh_ddt
#includeconio.h
#includeiostream
using namespace std;
int main()
{
char crew[2][2][10];
cincrew[0];
coutendl;
cincrew[1];
coutcrew[0][0]crew[0][1]crew[1][0]crew[1][1];
getch();
return 0;
}

now if I give input jack sparrow robert langdon
crew[o][o] should be jack
crew[0][1] should be sparrow
crew[1][0] should be robert
crew[1][1] sbould b2 langdon
but this is incorrect

-- 
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/-/1skPXOE7zboJ.
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.



[algogeeks] Datastructure and algorithms book

2012-06-05 Thread arun prakash
Can anyone pls mail me good datastrucutre and algo books..or any link to 
download those books..thanks in advance 

-- 
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/-/S3oFJ1RDgZ8J.
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.



Re: [algogeeks] importance of heaps

2012-06-05 Thread Jeevitesh
From interview perspective i think min-max heaps are enough.
You should be able to identify situations where you can apply them.

I do not think other heaps are of any use.

On Tue, Jun 5, 2012 at 11:40 AM, Abhishek Sharma abhi120...@gmail.comwrote:

 can anyone please tell me how important are heaps as compared to other
 data structures (from interview's point of view). i am not talking about
 simple min/max heaps, but advanced ones like fibonacci heaps and binomial
 heaps

 --
 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.




-- 
*Thanks,
Jeevitesh Shekhar Singh.*

-- 
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.



Re: [algogeeks] importance of heaps

2012-06-05 Thread Prem Krishna Chettri
Each DS has its own importance. So before you approach a problem , it is
better to understand the advantage of each DS. Infact, the Fibonacci heap
is having an big advantage of O(1) time searching element, which is
extremely significant as even the DS like Trie can't afford to do so.. All
in all, if I would take a call, it would like to grap a bit of possible DS
that can be helpful.

So, if you are looking for Google/Facebook/Amazon etc, they expect you to
have a bit of info. I remember one of my colleague getting the significant
question from heap itself which he can't answer properly !!!

BR,
Prem

On Tue, Jun 5, 2012 at 12:26 PM, Jeevitesh jeeviteshshekha...@gmail.comwrote:

 From interview perspective i think min-max heaps are enough.
 You should be able to identify situations where you can apply them.

 I do not think other heaps are of any use.


 On Tue, Jun 5, 2012 at 11:40 AM, Abhishek Sharma abhi120...@gmail.comwrote:

 can anyone please tell me how important are heaps as compared to other
 data structures (from interview's point of view). i am not talking about
 simple min/max heaps, but advanced ones like fibonacci heaps and binomial
 heaps

 --
 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.




 --
 *Thanks,
 Jeevitesh Shekhar Singh.*


  --
 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.



[algogeeks] Re: interview HARD problem

2012-06-05 Thread rafi
you mean like scramble ?

On Jun 5, 5:39 am, Ashish Goel ashg...@gmail.com wrote:
 preparing a sample itself is a great problem here, that is why i called it
 hard

 all words in the rectangle horizontally as well as vertically needs to be
 valid dictionary words

 Ashish
 Hassan

 say this rectangle AH,SA,HS,IS,SA,HN should also be valid dictonary words,
 indeed they are not..

 definitely we will need a multimap to have words of same length forming a
 bucket..not able to think beyond this

 Best Regards
 Ashish Goel
 Think positive and find fuel in failure
 +919985813081
 +919966006652







 On Mon, Jun 4, 2012 at 6:38 PM, Hassan Monfared hmonfa...@gmail.com wrote:
  Give a sample please

  On Mon, Jun 4, 2012 at 5:34 PM, Ashish Goel ashg...@gmail.com wrote:

  Given a dictionary of millions of words, give an algorithm to find the
  largest possible rectangle of letter that every row forms a word(reading
  left to right) and every column forms a word(reading from top to bottom).

  Best Regards
  Ashish Goel
  Think positive and find fuel in failure
  +919985813081
  +919966006652

  --
  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.

-- 
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.



Re: [algogeeks] want to create a table of words having 2 columns seperate for name and surname

2012-06-05 Thread Prem Krishna Chettri
More than a programming, I believe  this is a logical question. Some of the
assumption you can take into consideration is how many names a particular
person can possibly have. say, John F Kennedy, So, your array now can't
hold 3 names in two dimension, so what you wanna do, increase an array of
one more dimension? or make John F in one and kennedy in other.

 Now programming is fairly easy after you hv fixed your approach, alll you
have to do is make sure what goes in first dimension and what in second or
so.. and accordinly push it.

Also I got confusion here are you expecting command like argument . as givn
in sample input, than use argv / argc .. why cout/cin !!! Anyway.. try your
luck !!

BR,
Prem

On Tue, Jun 5, 2012 at 2:35 PM, daksh_ddt dakshtapa...@gmail.com wrote:

 #includeconio.h
 #includeiostream
 using namespace std;
 int main()
 {
 char crew[2][2][10];
 cincrew[0];
 coutendl;
 cincrew[1];
 coutcrew[0][0]crew[0][1]crew[1][0]crew[1][1];
 getch();
 return 0;
 }

 now if I give input jack sparrow robert langdon
 crew[o][o] should be jack
 crew[0][1] should be sparrow
 crew[1][0] should be robert
 crew[1][1] sbould b2 langdon
 but this is incorrect

 --
 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/-/1skPXOE7zboJ.
 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.



Re: [algogeeks] Re: interview HARD problem

2012-06-05 Thread Ashish Goel
yes, but this rectangle clause is troubling me...

Best Regards
Ashish Goel
Think positive and find fuel in failure
+919985813081
+919966006652


On Tue, Jun 5, 2012 at 3:18 PM, rafi rafiwie...@gmail.com wrote:

 you mean like scramble ?

 On Jun 5, 5:39 am, Ashish Goel ashg...@gmail.com wrote:
  preparing a sample itself is a great problem here, that is why i called
 it
  hard
 
  all words in the rectangle horizontally as well as vertically needs to be
  valid dictionary words
 
  Ashish
  Hassan
 
  say this rectangle AH,SA,HS,IS,SA,HN should also be valid dictonary
 words,
  indeed they are not..
 
  definitely we will need a multimap to have words of same length forming a
  bucket..not able to think beyond this
 
  Best Regards
  Ashish Goel
  Think positive and find fuel in failure
  +919985813081
  +919966006652
 
 
 
 
 
 
 
  On Mon, Jun 4, 2012 at 6:38 PM, Hassan Monfared hmonfa...@gmail.com
 wrote:
   Give a sample please
 
   On Mon, Jun 4, 2012 at 5:34 PM, Ashish Goel ashg...@gmail.com wrote:
 
   Given a dictionary of millions of words, give an algorithm to find the
   largest possible rectangle of letter that every row forms a
 word(reading
   left to right) and every column forms a word(reading from top to
 bottom).
 
   Best Regards
   Ashish Goel
   Think positive and find fuel in failure
   +919985813081
   +919966006652
 
   --
   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.

 --
 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.



Re: [algogeeks] Datastructure and algorithms book

2012-06-05 Thread Rathish Kannan
http://books.google.co.in/books/about/Introduction_To_Algorithms.html?id=NLngYyWFl_YC


--  RK :)


On Tue, Jun 5, 2012 at 12:32 PM, arun prakash arunslb...@gmail.com wrote:

 Can anyone pls mail me good datastrucutre and algo books..or any link to
 download those books..thanks in advance

 --
 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/-/S3oFJ1RDgZ8J.
 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.



Re: [algogeeks] Datastructure and algorithms book

2012-06-05 Thread mohit mishra
Introduction To Algorithms By Clifford Stein, Thomas H Cormen, Ronald L
Rivest, Charles E Leiserson






On Tue, Jun 5, 2012 at 12:32 PM, arun prakash arunslb...@gmail.com wrote:

 Can anyone pls mail me good datastrucutre and algo books..or any link to
 download those books..thanks in advance

 --
 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/-/S3oFJ1RDgZ8J.
 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.



Re: [algogeeks] Datastructure and algorithms book

2012-06-05 Thread Rahul Kumar Patle
go though 4shared.com and esnips.com
huge online storage of shared files including pdf..

On Tue, Jun 5, 2012 at 12:32 PM, arun prakash arunslb...@gmail.com wrote:

 Can anyone pls mail me good datastrucutre and algo books..or any link to
 download those books..thanks in advance

 --
 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/-/S3oFJ1RDgZ8J.
 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.




-- 
Thanks and Regards:
Rahul Kumar Patle
M.Tech, School of Information Technology
Indian Institute of Technology, Kharagpur-721302, India
Mobile No: +91-8798049298, +91-9424738542
patlerahulku...@gmail.com
rahulkumarpa...@yahoo.com

-- 
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.



Re: [algogeeks] Datastructure and algorithms book

2012-06-05 Thread vikalap mahajan
http://torrentz.eu/search?f=data++structures

download the toprated book you like !using utorrent

-- 
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.



[algogeeks] Re: interview HARD problem

2012-06-05 Thread Gene
Does this sufficae?

Suppose you were using a dictionary from the frapplewonk language,
which has only 5 words:

tab
oma
to
am
ba

Then the biggest rectangle is clearly

tab
oma



On Jun 4, 10:39 pm, Ashish Goel ashg...@gmail.com wrote:
 preparing a sample itself is a great problem here, that is why i called it
 hard

 all words in the rectangle horizontally as well as vertically needs to be
 valid dictionary words

 Ashish
 Hassan

 say this rectangle AH,SA,HS,IS,SA,HN should also be valid dictonary words,
 indeed they are not..

 definitely we will need a multimap to have words of same length forming a
 bucket..not able to think beyond this

 Best Regards
 Ashish Goel
 Think positive and find fuel in failure
 +919985813081
 +919966006652



 On Mon, Jun 4, 2012 at 6:38 PM, Hassan Monfared hmonfa...@gmail.com wrote:
  Give a sample please

  On Mon, Jun 4, 2012 at 5:34 PM, Ashish Goel ashg...@gmail.com wrote:

  Given a dictionary of millions of words, give an algorithm to find the
  largest possible rectangle of letter that every row forms a word(reading
  left to right) and every column forms a word(reading from top to bottom).

  Best Regards
  Ashish Goel
  Think positive and find fuel in failure
  +919985813081
  +919966006652

  --
  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.

-- 
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.



Re: [algogeeks] Re: amazon interview questions

2012-06-05 Thread Lomash Goyal
is geke is a invalid strng?

On Tue, Jun 5, 2012 at 12:17 PM, Hassan Monfared hmonfa...@gmail.comwrote:

 Ashish:

 the algorithm passes over string and check if there is any substring with
 len=1 is repeated or not. if not, tries for substring with len 2,... and so
 on.
 max length of substring which can be repeated can be at most  N/2.


 Regards,


 On Tue, Jun 5, 2012 at 10:48 AM, Ashish Goel ashg...@gmail.com wrote:

 The problem suggests that a character can't be more than once present and
 thereby it can be done by just having s bitmap and if a char repeats, any
 longer repeating substring will have those char repeated atleast twice,
 hence O(n) solution.


 Also, Hasaan: how is your algo O(n2) for for-while-for chain?

 Best Regards
 Ashish Goel
 Think positive and find fuel in failure
 +919985813081
 +919966006652


 On Tue, Jun 5, 2012 at 11:42 AM, Ashish Goel ashg...@gmail.com wrote:

 Hassan, can you explain your algo?

 Best Regards
 Ashish Goel
 Think positive and find fuel in failure
 +919985813081
 +919966006652


 On Mon, Jun 4, 2012 at 11:20 AM, Hassan Monfared hmonfa...@gmail.comwrote:

 for



  --
 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.




-- 
Regards

Lomash Goyal
*
*

-- 
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.



Re: [algogeeks] Re: interview HARD problem

2012-06-05 Thread partha sarathi Mohanty
no
if ta/om/to/am/ba/batot/amoma are words then it should be the one. no
5*2  3*3

On Tue, Jun 5, 2012 at 7:45 PM, Gene gene.ress...@gmail.com wrote:

 Does this sufficae?

 Suppose you were using a dictionary from the frapplewonk language,
 which has only 5 words:

 tab
 oma
 to
 am
 ba

 Then the biggest rectangle is clearly

 tab
 oma



 On Jun 4, 10:39 pm, Ashish Goel ashg...@gmail.com wrote:
  preparing a sample itself is a great problem here, that is why i called
 it
  hard
 
  all words in the rectangle horizontally as well as vertically needs to be
  valid dictionary words
 
  Ashish
  Hassan
 
  say this rectangle AH,SA,HS,IS,SA,HN should also be valid dictonary
 words,
  indeed they are not..
 
  definitely we will need a multimap to have words of same length forming a
  bucket..not able to think beyond this
 
  Best Regards
  Ashish Goel
  Think positive and find fuel in failure
  +919985813081
  +919966006652
 
 
 
  On Mon, Jun 4, 2012 at 6:38 PM, Hassan Monfared hmonfa...@gmail.com
 wrote:
   Give a sample please
 
   On Mon, Jun 4, 2012 at 5:34 PM, Ashish Goel ashg...@gmail.com wrote:
 
   Given a dictionary of millions of words, give an algorithm to find the
   largest possible rectangle of letter that every row forms a
 word(reading
   left to right) and every column forms a word(reading from top to
 bottom).
 
   Best Regards
   Ashish Goel
   Think positive and find fuel in failure
   +919985813081
   +919966006652
 
   --
   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.

 --
 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.



[algogeeks] Partition-Efficient algorithm.

2012-06-05 Thread pankajsingh
What is the efficient algorithm to partition a big number like 1000 into
500 parts such that each part is=0,i need to know all the partition ;ex
partition of 5 into 3,4 1 0,3 1 1,2 2 1,i know brute force methods..please
provide some algorithm which is feasible to calculate all the partition
upto 1000..

-- 
Pankaj Singh
B.Tech in Computer Science and Engineering - lllrd year
IIT Roorkee, India

-- 
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.



[algogeeks] Re: interview HARD problem

2012-06-05 Thread Prankur
But then all these words
ta, om ,., amoma all should be available in the dictionary i.e
they should be valid words.


On Jun 5, 11:32 am, partha sarathi Mohanty
partha.mohanty2...@gmail.com wrote:
 no
 if ta/om/to/am/ba/batot/amoma are words then it should be the one. no
 5*2  3*3







 On Tue, Jun 5, 2012 at 7:45 PM, Gene gene.ress...@gmail.com wrote:
  Does this sufficae?

  Suppose you were using a dictionary from the frapplewonk language,
  which has only 5 words:

  tab
  oma
  to
  am
  ba

  Then the biggest rectangle is clearly

  tab
  oma

  On Jun 4, 10:39 pm, Ashish Goel ashg...@gmail.com wrote:
   preparing a sample itself is a great problem here, that is why i called
  it
   hard

   all words in the rectangle horizontally as well as vertically needs to be
   valid dictionary words

   Ashish
   Hassan

   say this rectangle AH,SA,HS,IS,SA,HN should also be valid dictonary
  words,
   indeed they are not..

   definitely we will need a multimap to have words of same length forming a
   bucket..not able to think beyond this

   Best Regards
   Ashish Goel
   Think positive and find fuel in failure
   +919985813081
   +919966006652

   On Mon, Jun 4, 2012 at 6:38 PM, Hassan Monfared hmonfa...@gmail.com
  wrote:
Give a sample please

On Mon, Jun 4, 2012 at 5:34 PM, Ashish Goel ashg...@gmail.com wrote:

Given a dictionary of millions of words, give an algorithm to find the
largest possible rectangle of letter that every row forms a
  word(reading
left to right) and every column forms a word(reading from top to
  bottom).

Best Regards
Ashish Goel
Think positive and find fuel in failure
+919985813081
+919966006652

--
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.

  --
  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.



Re: [algogeeks] Re: amazon interview questions

2012-06-05 Thread Hassan Monfared
yes It's valid, cuz  it doesn't have any repeated substring next together

On Tue, Jun 5, 2012 at 7:08 PM, Lomash Goyal lomesh.go...@gmail.com wrote:

 is geke is a invalid strng?


 On Tue, Jun 5, 2012 at 12:17 PM, Hassan Monfared hmonfa...@gmail.comwrote:

 Ashish:

 the algorithm passes over string and check if there is any substring with
 len=1 is repeated or not. if not, tries for substring with len 2,... and so
 on.
 max length of substring which can be repeated can be at most  N/2.


 Regards,


 On Tue, Jun 5, 2012 at 10:48 AM, Ashish Goel ashg...@gmail.com wrote:

 The problem suggests that a character can't be more than once present
 and thereby it can be done by just having s bitmap and if a char repeats,
 any longer repeating substring will have those char repeated atleast twice,
 hence O(n) solution.


 Also, Hasaan: how is your algo O(n2) for for-while-for chain?

 Best Regards
 Ashish Goel
 Think positive and find fuel in failure
 +919985813081
 +919966006652


 On Tue, Jun 5, 2012 at 11:42 AM, Ashish Goel ashg...@gmail.com wrote:

 Hassan, can you explain your algo?

 Best Regards
 Ashish Goel
 Think positive and find fuel in failure
 +919985813081
 +919966006652


 On Mon, Jun 4, 2012 at 11:20 AM, Hassan Monfared 
 hmonfa...@gmail.comwrote:

 for



  --
 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.




 --
 Regards

 Lomash Goyal

 *
 *


  --
 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.