Re: [algogeeks] Finite state automata accpt string of length 6

2012-10-26 Thread rahul sharma
should i take it how many ways are there to reach from start to the top right destination...x,y,z,a,b,c, are i/p statexyzabc one stringabc xyz is another...if m ryt then is dere any formulla to calute or we have to do it manuall On Sat, Oct 27, 2012 at 11:02 AM, rahul sharma wrote:

Re: [algogeeks] Finite state automata accpt string of length 6

2012-10-26 Thread rahul sharma
can u please elaborate...i am not able to understand the figure..plz explainit would be of great help On Sat, Oct 27, 2012 at 5:57 AM, payal gupta wrote: > should be 6C3 or 20 perhaps. > > On Sat, Oct 27, 2012 at 3:29 AM, rahul sharma wrote: > >> Finite state automata accpt string of length 6

Re: [algogeeks] INTERVIEW QUESTION

2012-10-26 Thread payal gupta
Sorry ,posted the wrong question initially actually i needed the algo for this question. Thanx. On Saturday, October 27, 2012 7:04:10 AM UTC+5:30, raghavan wrote: > > By any chance did you read the new blog post by Gayle Laakmaan.. > > I guess to detect typos we can use some sort of Trie imple

Re: [algogeeks] INTERVIEW QUESTION

2012-10-26 Thread Kartik Sachan
@payal why u need this..??...:P:P -- 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

Re: [algogeeks] INTERVIEW QUESTION

2012-10-26 Thread Raghavan
By any chance did you read the new blog post by Gayle Laakmaan.. I guess to detect typos we can use some sort of Trie implementation.. On Fri, Oct 26, 2012 at 7:50 PM, payal gupta wrote: > >Given a cube with sides length n, write code to print all possible > paths from the center to the su

[algogeeks] INTERVIEW QUESTION

2012-10-26 Thread payal gupta
Given a cube with sides length n, write code to print all possible paths from the center to the surface. Thanx in advance. Regards, PAYAL GUPTA, NIT-B. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To view this discu

[algogeeks] INTERVIEW QUESTION

2012-10-26 Thread payal gupta
Design the data structures and algorithms to detect typos in a document and then provide suggestions to the user. Thanx in advance, Regards, PAYAL GUPTA, NIT-B. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To view this d

Re: [algogeeks] BIG O

2012-10-26 Thread payal gupta
That 's correct. On Sat, Oct 27, 2012 at 3:25 AM, rahul sharma wrote: > for k=1 to n > { > j=k; > while(j>0) > j=j/2; > } > the complexity is big o is o(nlogn) > am i ryt > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to

Re: [algogeeks] Finite state automata accpt string of length 6

2012-10-26 Thread payal gupta
should be 6C3 or 20 perhaps. On Sat, Oct 27, 2012 at 3:29 AM, rahul sharma wrote: > Finite state automata accpt string of length 6 > > what is total number of strings in set..please find the attahcment > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm

[algogeeks] BIG O

2012-10-26 Thread rahul sharma
for k=1 to n { j=k; while(j>0) j=j/2; } the complexity is big o is o(nlogn) am i ryt -- 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 ema

[algogeeks] Advice needed

2012-10-26 Thread rahul sharma
There is question asked like O/p of following in C(32 bit OS) #include #include using namespace std; bool IsEqual(char * a) { printf("abc"); return true; } int main() { char str[30]; printf("%d",sizeof(sizeof(IsEqual(str; getchar(); return 0; } I run with .cppi

[algogeeks] Re: Range Checking Efficiently C++

2012-10-26 Thread Don
What you have written is the most efficient way to check that condition in general. Don On Oct 25, 9:37 am, Atul Singh wrote: > Is there a efficient way to check the range of numbers in C++ > > Suppose if x is to checked in range a and b both exclusive > > ie if ( x > a && x < b ) > > Is there an

[algogeeks] Re: Sequence Point C with postincremented

2012-10-26 Thread Don
The postincrement does take place when you reach the &&, so anything after the && would have a=1, but the value of the expression a++ is still zero. By the definition of postincrement, a++ has the value of a before the increment. If you wrote int a = 0; int j = a++ || a; You will end up with j=1

[algogeeks] Re: Random Number generation

2012-10-26 Thread Don
How you chose from the wide array of pseudo-random generators available depends a lot on how you intend to use it. If you just need something that seems random in a video game, a LCG is probably fine. However, you could fill a large bookshelf with studies which were invalidated because they used ra

[algogeeks] Pre/Post L and r value

2012-10-26 Thread rahul sharma
why pre inc. is l value and post is r value..please explain -- 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...@

[algogeeks] Sequence Point C with postincremented

2012-10-26 Thread rahul sharma
Guys plz tell that postincremented variable is incremented after sequence or after ; as we have && || comma and ; as sequence point so say we have int i=10; int j=(i++,i++); firstly i++ goes and as comma comes so ++ post inc. takes place and take to 11 ..now when next time the postincremented is