Re: [algogeeks] Re: bfs

2012-08-10 Thread Hanlei Qin
use STL map<> is works, but I recommended the unordered_map<> it is in C++11 standard implement by hashing, you can try. On Sat, Aug 11, 2012 at 5:49 AM, tendua wrote: > > If nodes are numbered then simply make a boolean array and make the > corresponding element true after visiting the node. If

[algogeeks] Re: bfs

2012-08-10 Thread tendua
If nodes are numbered then simply make a boolean array and make the corresponding element true after visiting the node. If nodes are string then go for hashing. In Java you can use HashMap otherwise it'll take a little more effort to implement it. -- You received this message because you are

Re: [algogeeks] Re: AMAZON: given col id, print col name in excel

2012-08-10 Thread yq Zhang
@shiv, your code is correct go compute the base 26 number. However, this question is not base 26 number obviously. On Wed, Aug 8, 2012 at 4:46 AM, shiv narayan wrote: > this is similar to conversion of no in base 26.( where digits are > a,b,c,d...z) just think it like decimal to binary conversi

Re: [algogeeks] longest continuous sequence

2012-08-10 Thread yq Zhang
def long_continuous_seq(A): ls = {} result = (0,0) for x in A: if not x in ls: left = ls[x - 1] if (x - 1) in ls else 0 right = ls[x + 1] if (x + 1) in ls else 0 if left + right + 1 > result[1] - result[0]: result = (x - left,

[algogeeks] Data Cache implementation problem

2012-08-10 Thread Varma Selvaraj
A data cache needs to be implemented for the top 100 data items selected based on their frequency of access. The most frequent data member must be accessed fastest. And the access time/iterations of each data member from the cache should correspond to the frequncy of its access. Please choose the

[algogeeks] google paper

2012-08-10 Thread deepikaanand
Somebody from DCE plz tell the paper pattern of google... -- 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/-/BjLRVjRlekIJ. To post to this group, send email to