[algogeeks] Re: Programming Problem

2012-07-25 Thread Tushar
i think we cannot change the order of the characters On Thursday, 19 July 2012 11:00:20 UTC+5:30, gobind hemb wrote: String s is called *unique* if all the characters of s are different. String s2 is *producible* from string s1, if we can remove some characters of s1 to obtain s2. String

Re: [algogeeks]

2012-07-25 Thread Navin Kumar
#include stdio.h #include stdlib.h #include ctype.h char *decrypt(char *s) { int n; char *digit = (char *)malloc(sizeof(char) * 5); char *p1 = (char *)malloc(sizeof(char) * 1024); char *p = p1; char *digit2; char prev; prev = *s; *p++ = *s++; while(s != '\0') {

Re: [algogeeks]

2012-07-25 Thread Navin Kumar
logic is very simple ...just trace the program you will understand. On Wed, Jul 25, 2012 at 7:28 PM, Navin Kumar algorithm.i...@gmail.comwrote: #include stdio.h #include stdlib.h #include ctype.h char *decrypt(char *s) { int n; char *digit = (char *)malloc(sizeof(char) * 5); char

[algogeeks] adobe aptitude test

2012-07-25 Thread deepikaanand
can anybody tell me which topics are asked in adobe apti test...and what is the usual level of qs asked in aptitude test... -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit

[algogeeks] output

2012-07-25 Thread jatin
anybdy has basic trie implementation (insertion and printing) ? o/p 1) main() { char *p1=Name; char *p2; p2=(char *)malloc(20); while(*p2++=*p1++); printf(%s\n,p2); } ...it's giving me empty string 2) i=5; printf(%d,i++ * i++); o/p and also tell the reason? -- You received this message

[algogeeks] Re: output

2012-07-25 Thread deepikaanand
for the first o/p qs as p1 is moving towards the NULL('\0') character so is p2...to avoid dis save the base address and den let p2 move forward with p1 char *p1=Name; char *p2; p2=(char *)malloc(20); char *save; save = (char *)malloc(20); save = p2; if(p2==NULL) cout\n NOT ENOUGH SPACE; else {

Re: [algogeeks] Re: output

2012-07-25 Thread vindhya chhabra
for the first, p2 has moved beyond null character, so do char *c=p and then print string for c. for second , since the same object is modified more than once between two sequence points, so it gives compiler dependent answer.if it wud have been i++||i++ , then the answer would have been defined

[algogeeks] Re: output

2012-07-25 Thread jatin
On Wednesday, 25 July 2012 20:20:02 UTC+5:30, jatin wrote: anybdy has basic trie implementation (insertion and printing) ? o/p 1) main() { char *p1=Name; char *p2; p2=(char *)malloc(20); while(*p2++=*p1++); printf(%s\n,p2); } ...it's giving me empty string 2) i=5; printf(%d,i++

[algogeeks] Re: output

2012-07-25 Thread jatin
For the first o/p even though i save it like u have done then too it's showing me an empty string . for 2nd as Vindya has stated it should give me error but my compiler is showing me 30 as it's output(the ans shd be 25 if not error) ? On Wednesday, 25 July 2012 20:42:56 UTC+5:30,

[algogeeks] Re: [Amazon]

2012-07-25 Thread deepikaanand
every element in 3D array can be written in the form of *(*(*(a+i)+j)+k) = a[i][j][k] ele = required element to be searched for say M = number of 3D matrices R = number of row C = number of col First find the most probable matrix in which the element might be present fix j = R-1 fix k = C-1

[algogeeks] Re: output

2012-07-25 Thread jatin
On Wednesday, 25 July 2012 20:59:47 UTC+5:30, jatin wrote: For the first o/p even though i save it like u have done then too it's showing me an empty string . for 2nd as Vindya has stated it should give me error but my compiler is showing me 30 as it's output(the ans shd be 25 if not

[algogeeks] Re: output

2012-07-25 Thread deepikaanand
@ jatin then there is something wrong I executed d same prog which I have pasted here...it was giving me the correct answer and for the second qs has no absolute answer it depends on compiler -- You received this message because you are subscribed to the Google Groups Algorithm Geeks

[algogeeks] Re: output

2012-07-25 Thread jatin
Trie ??if u have it to mail kardio... On Wednesday, 25 July 2012 21:10:55 UTC+5:30, deepikaanand wrote: @ jatin then there is something wrong I executed d same prog which I have pasted here...it was giving me the correct answer and for the second qs has no absolute answer it depends on

Re: [algogeeks] Re: output

2012-07-25 Thread Prem Krishna Chettri
Well Guys, M here just to show wats hpning.. Have your own views.. 1 Everything is right till While loop.. I mean p1 pointing to the heap of the address of the String Name , P1 getting 20 bytes of memory chunk and so on.. So here we go now. As this Stupid looking while is culprit here

[algogeeks] Re: output

2012-07-25 Thread deepikaanand
sent... On Wednesday, July 25, 2012 9:18:46 PM UTC+5:30, jatin wrote: Trie ??if u have it to mail kardio... On Wednesday, 25 July 2012 21:10:55 UTC+5:30, deepikaanand wrote: @ jatin then there is something wrong I executed d same prog which I have pasted here...it was giving me the