Re: [algogeeks] Programming Problem

2012-07-20 Thread ashish jain
.. and use inorder parsing to get 'ba' as the unique beautiful string. On Fri, Jul 20, 2012 at 12:22 PM, piyush khanna wrote: > @ashish jain :then what for aaab.. > > -- > *From:* ashish jain > *To:* algogeeks@googlegroups.com > *Sent:*

Re: [algogeeks] Programming Problem

2012-07-19 Thread ashish jain
if from the string s.. a binary search tree (with higher value alphabets on the left side of the root and lower value alphabets on the right side of root) is formed removing the repeated characters during the formation of he BST and then applying inorder technique to get the string s2. String S2 w

Re: [algogeeks]

2012-07-15 Thread ashish jain
@Vindhya every time least is getting 101-'e' as the value. and not llo as the statement least = (*ptrwrote: > please someone explain > > > On Sun, Jul 15, 2012 at 3:54 PM, vindhya chhabra > wrote: > >> #include >> main() >> { >> char * str = "hello"; >> char * ptr = str; >> char least = 127; >>

Re: [algogeeks] C o/p

2012-07-08 Thread ashish jain
I think it should output: 9 9 On Sun, Jul 8, 2012 at 11:42 PM, md shaukat ali wrote: > but i am confused in this problem... > int a=10; > int b; > b=--a--; > printf("%d %d",a,b);..what will output? > > > On Sun, Jul 8, 2012 at 11:39 PM, md shaukat ali > wrote: > >> agree with adarsh >> >> >> On

Re: [algogeeks] Re: Question asked in Amazon online test

2012-06-23 Thread ashish jain
@all yaa.. For getting number of swaps.. we have to calculate total number of zeroes on the right for each '1' and on adding them we will get the number of swaps. and in O(n) time. On Sat, Jun 23, 2012 at 1:16 PM, Guruprasad Sridharan < sridharan.mi...@gmail.com> wrote: > It will work because