Re: [algogeeks] Re: finding triplets

2011-08-06 Thread programming love
http://stackoverflow.com/questions/2032153/how-to-find-pythagorean-triplets-in-an-array-faster-than-on2 It provides a perfect solution -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroup

Re: [algogeeks] xplanation plz

2011-08-06 Thread Kunal Patil
@Saurabh: +1 for your second code. On Sun, Aug 7, 2011 at 12:17 PM, Amol Sharma wrote: > nice :) > -- > > > Amol Sharma > Third Year Student > Computer Science and Engineering > MNNIT Allahabad > > > > > On Sun, Aug 7, 2011 at 8:16 AM, saurabh singh wrote: > >> Yup it was due to compiler optimi

Re: [algogeeks] xplanation plz

2011-08-06 Thread Amol Sharma
nice :) -- Amol Sharma Third Year Student Computer Science and Engineering MNNIT Allahabad On Sun, Aug 7, 2011 at 8:16 AM, saurabh singh wrote: > Yup it was due to compiler optimization.check this link now,,, > http://ideone.com/f7keg > > > On Sun, Aug 7, 2011 at 8:02 AM, saurabh singh

Re: [algogeeks] Paypal interview Questions

2011-08-06 Thread Amol Sharma
@raghvan: take care of space complexityyou are using extra space that too O(n) in worst case... can be done in O(nlogn) else it can be done in O(n) if the given array is sorted in two traversals !! -- Amol Sharma Third Year Student Computer Science and Engineering MNNIT Allahabad On Sun

Re: [algogeeks] Re: Directi Question

2011-08-06 Thread shady
Dave shouldn't it be :: E(x) = Summation( xp(x) ) thus it should be 1*1/2 + 2*(1/2 * 1/2) + 3*(1/2 * 1/2 * 1/2) . On Sun, Aug 7, 2011 at 11:55 AM, Nitish Garg wrote: > @Dave - Can you please explain how did you generate the series? Shouldn't > it be : 1/2 + 2(1/4) + 3(1/8) and so

Re: [algogeeks] Re: Microsoft :)

2011-08-06 Thread programming love
@harshal: What was your score in the written round?? > -- 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...@go

Re: [algogeeks] MS test

2011-08-06 Thread programming love
And the last option?? Will that terminate too?? On Sun, Aug 7, 2011 at 11:48 AM, ankit sambyal wrote: > @programming love : 0.1 can't be represented accurately in binary. If u try > to convert it into binary, it will not terminate. Try it !! But 6.5 can be > converted. > > -- > You received this

[algogeeks] Re: Directi Question

2011-08-06 Thread Nitish Garg
@Dave - Can you please explain how did you generate the series? Shouldn't it be : 1/2 + 2(1/4) + 3(1/8) and so on? -- 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/algo

Re: [algogeeks] MS written test qs

2011-08-06 Thread Ravinder Kumar
Method 1 : Use character array to store large number . Define addition & subtraction function for the following representation of number . Using addition & subtraction number u can write another operation for the library e.g. multiplication , division , modulus etc . Method 2 : Use Linked list to

Re: [algogeeks] MS test

2011-08-06 Thread ankit sambyal
@programming love : 0.1 can't be represented accurately in binary. If u try to convert it into binary, it will not terminate. Try it !! But 6.5 can be converted. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send ema

Re: [algogeeks] MS test

2011-08-06 Thread programming love
Why is it so and y can't 0.1 be represented accurately in binary?? And what about the last option?? On Sun, Aug 7, 2011 at 11:43 AM, ankit sambyal wrote: > @programming love : 6.5 can be represented accurately in binary > > -- > You received this message because you are subscribed to the Google G

Re: [algogeeks] MS test

2011-08-06 Thread ankit sambyal
@programming love : 6.5 can be represented accurately in binary -- 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] MS written test qs

2011-08-06 Thread deepikaanand
can any1 plz gv the solution of the following problem ;- You have to make a package library which will do the calculation of (a^b)mod(c), where a, b, c are very large size of 1 digits. (^- power). Design a data structure for the numbers' storage and suggest what functions will you be providing

Re: [algogeeks] Paypal interview Questions

2011-08-06 Thread programming love
So is q 1 a C++ question?? On Sun, Aug 7, 2011 at 11:27 AM, hary rathor wrote: > no c doesn't > > -- > 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 th

Re: [algogeeks] MS test

2011-08-06 Thread programming love
Why can't it be option b for 3rd one?? On Sun, Aug 7, 2011 at 11:30 AM, sukran dhawan wrote: > a > > On Sun, Aug 7, 2011 at 11:07 AM, programming love < > love.for.programm...@gmail.com> wrote: > >> What is the answer for 3rd one?? 4th is 5. >> >> -- >> You received this message because you are s

Re: [algogeeks] MS test

2011-08-06 Thread sukran dhawan
a On Sun, Aug 7, 2011 at 11:07 AM, programming love < love.for.programm...@gmail.com> wrote: > What is the answer for 3rd one?? 4th is 5. > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@

Re: [algogeeks] Paypal interview Questions

2011-08-06 Thread hary rathor
no c doesn't -- 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

Re: [algogeeks] Paypal interview Questions

2011-08-06 Thread programming love
Does C support default arguments in function prototype?? -- 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...@goo

Re: [algogeeks] must read! a short cut method for apti!

2011-08-06 Thread kumar raja
good answer On 6 August 2011 22:46, programming love wrote: > *a nice post to find the number of zeroes in product of first n natural > numbers!* > http://forums.sureshkumar.net/brain-teasers-puzzles/22998-number-zeros.html > > -- > You received this message because you are subscribed to the

[algogeeks] must read! a short cut method for apti!

2011-08-06 Thread programming love
*a nice post to find the number of zeroes in product of first n natural numbers!* http://forums.sureshkumar.net/brain-teasers-puzzles/22998-number-zeros.html -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to

Re: [algogeeks] Paypal interview Questions

2011-08-06 Thread hary rathor
@delip ; have you not got that it require single strict O(n) just single pass you are doing it in O(n^2) -- 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

[algogeeks] Re: finding triplets

2011-08-06 Thread Dave
@Coder: Sort the array into ascending order of the squares of the values; e.g., if the data is -2, 1, 3, then the sorted result should be 1, -2, 3 because 1*1 < (-2)*(-2) < 3*3. Then apply the following pseudo-code: for k = 3 to n // 1-based indexing assumed i = 1 j = k-1 while i < j d

Re: [algogeeks] question

2011-08-06 Thread hary rathor
in a 64 bit computer is that is capable of transfer 64 bit at a time 64 bit os means it capable of handle these 64 bit at time .but 32 it os use only half of bus so "theorytically not practically" 64 bit is 8 time faster than 32 bit os . and 64 bit os can address more ram at time . cause of wide 6

[algogeeks] MS test

2011-08-06 Thread programming love
What is the answer for 3rd one?? 4th is 5. -- 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.

[algogeeks] question

2011-08-06 Thread UTKARSH SRIVASTAV
difference between 64-bit compiler and 64-bit operating system..sizeof any data type depends on compiler or operating system -- *UTKARSH SRIVASTAV CSE-3 B-Tech 3rd Year @MNNIT ALLAHABAD* -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks"

Re: [algogeeks] Random number

2011-08-06 Thread Gaurav Menghani
We can have a sorted sequence and display them in random order, but that is the same problem. How do we display them in random order? We need to have a sequence of random indices, that is the same problem as having random numbers, isn't it. Moreover, I don't think collisions can be avoided in less

Re: [algogeeks] Re: GS on campus

2011-08-06 Thread arvind kumar
@saurabh:wen wer the 5 rounds of puzzles asked??during interview? On Sun, Aug 7, 2011 at 8:23 AM, saurabh singh wrote: > Its lot of apti and damn easy c in technichal part,The paper was of 45 min > duration in which we had to do 35 questions(25 apti 10 tech),It was followed > by a group discussio

[algogeeks] finding triplets

2011-08-06 Thread coder dumca
given an array find all triplets such that a^2+b^2=c^2 -- 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...@googl

Re: [algogeeks]

2011-08-06 Thread rahul rai
Thats True , Even insertion and merge sorts are too .. !!! Rahul On Sun, Aug 7, 2011 at 10:20 AM, Gaurav Menghani wrote: > "The Postman's sort is a variant of bucket sort that takes advantage > of a hierarchical structure of elements, typically described by a set > of attributes." > > It is j

Re: [algogeeks]

2011-08-06 Thread Gaurav Menghani
"The Postman's sort is a variant of bucket sort that takes advantage of a hierarchical structure of elements, typically described by a set of attributes." It is just a variant of Bucket Sort. On Sun, Aug 7, 2011 at 12:42 AM, rahul rai wrote: > http://www.rrsd.com/software_development/postmans_so

[algogeeks] Anubhav Aggarwal wants to chat

2011-08-06 Thread Anubhav Aggarwal
--- Anubhav Aggarwal wants to stay in better touch using some of Google's coolest new products. If you already have Gmail or Google Talk, visit: http://mail.google.com/mail/b-aae2a11493-481f13b152-0NvcH9sxaSedEz97rN7rdin9p9Q You'

Re: [algogeeks] Paypal interview Questions

2011-08-06 Thread coder dumca
default arguments are added right to left , in first one it is left to right thats why error On Sat, Aug 6, 2011 at 9:41 AM, siddharth srivastava wrote: > Hi > > On 6 August 2011 12:08, swetha rahul wrote: > >> Hi, >> >> Q.No:1 >> what is wrong here >> void foo(int x=10,int y) >> how compile

Re: [algogeeks] Re: Directi question-centre of the tree

2011-08-06 Thread subramania jeeva
5 /\ 6 7 / 8 Here the centre is both 5 and 6 . we need to find both of them..:) Cheers ~ Jeeva ~ -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroup

Re: [algogeeks] size -------

2011-08-06 Thread coder dumca
on gcc it is 16 bytes and on dev cpp its 24 bytes On Sat, Aug 6, 2011 at 11:10 AM, siddharth srivastava wrote: > > > On 6 August 2011 23:27, Nitin wrote: > >> I am also getting 24 bytes but y it is taking it every data type as 8,8,8 >> as if we take it alone it is 1 for char and 4 for int a

Re: [algogeeks] Re: Microsoft :)

2011-08-06 Thread coder dumca
congrats man On Sat, Aug 6, 2011 at 5:14 AM, parag khanna wrote: > congrats dude ... can u plz tell me the questions asked ... microsoft is > visiting our campus on 29th > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to thi

Re: [algogeeks] Query to find the Nth highest salary in employee table

2011-08-06 Thread coder dumca
select top 1 salary from(select top 6 salary from employee order by salary desc)asc On Sat, Aug 6, 2011 at 6:40 PM, Reynald wrote: > Could anyone please explain me how this query selects the employee > with nth highest salary? > > select last_name, salary from employees e1 > where &n = (select

Re: [algogeeks] Re: GS on campus

2011-08-06 Thread saurabh singh
Its lot of apti and damn easy c in technichal part,The paper was of 45 min duration in which we had to do 35 questions(25 apti 10 tech),It was followed by a group discussion on social networking.Then interviews.5 rounds puzzles were also asked.Most of them were standard puzzles.. On Sun, Aug 7, 20

Re: [algogeeks] xplanation plz

2011-08-06 Thread saurabh singh
Yup it was due to compiler optimization.check this link now,,, http://ideone.com/f7keg On Sun, Aug 7, 2011 at 8:02 AM, saurabh singh wrote: > The value of a has changed but it doesnt appears so...Thats bcoz the > compilers are smart enough in dealing with const variables...The value has > ch

Re: [algogeeks] xplanation plz

2011-08-06 Thread saurabh singh
The value of a has changed but it doesnt appears so...Thats bcoz the compilers are smart enough in dealing with const variables...The value has changed but doesnt appears so when you print it. On Sun, Aug 7, 2011 at 1:15 AM, Jyoti Gupta <2006gu...@gmail.com> wrote: > but how do they both poin

Re: [algogeeks] nlogn, in-place, iterative mergesort?

2011-08-06 Thread Nitin Nizhawan
inplace? On Sat, Aug 6, 2011 at 10:27 PM, immanuel kingston < kingston.imman...@gmail.com> wrote: > Yes. just remove the recursive part using 2 stacks. > > Thanks, > Immanuel > > On Fri, Aug 5, 2011 at 6:51 PM, Nitin Nizhawan > wrote: > >> does anyone know of any in-place, iterative mergesort a

[algogeeks] Query to find the Nth highest salary in employee table

2011-08-06 Thread Reynald
Could anyone please explain me how this query selects the employee with nth highest salary? select last_name, salary from employees e1 where &n = (select count(distinct(salary)) from employees e2 where e2.salary >= e1.salary); -- You received this message because you are subscribed to the Google

Re: [algogeeks] Re: amazon online test format

2011-08-06 Thread Ankur Garg
@Yasir Thanks bro :) On Sat, Aug 6, 2011 at 7:13 PM, Yasir wrote: > Same as of DS & Algo in GATE exam. > http://geeksforgeeks.org/?cat=66 > > On Aug 7, 2:29 am, Ankur Garg wrote: > > @Yasir > > > > MCQ are of which types ??? > > > > Regards > > > > Ankur Garg > > > > > > > > > > > > > > > > On

[algogeeks] Re: amazon online test format

2011-08-06 Thread Yasir
Same as of DS & Algo in GATE exam. http://geeksforgeeks.org/?cat=66 On Aug 7, 2:29 am, Ankur Garg wrote: > @Yasir > > MCQ are of which types ??? > > Regards > > Ankur Garg > > > > > > > > On Sat, Aug 6, 2011 at 4:45 PM, Yasir wrote: > > Earlier they had telephonic interview as first round but no

[algogeeks] Re: MS test

2011-08-06 Thread TheMitraBoy
Guys ! If the i=n is a printing error, then its Ok. But if its not, shouldn't an assignment statement evaluate to a TRUE every time and the construct goes into an infinite loop. Am i going wrong somewhere ? On Aug 6, 10:13 pm, "pacific :-)" wrote: > I believe the answer for fifth one is o(n2)  ,

[algogeeks] Re: MS test

2011-08-06 Thread TheMitraBoy
Guys ! If the i=n is a printing error, then its Ok. But if its not, shouldn't an assignment statement evaluate to a TRUE every time and the construct goes into an infinite loop. Am i going wrong somewhere ? On Aug 6, 9:18 pm, i love programming wrote: > Hello guys! > Try finding answers for the M

Re: [algogeeks] Re: amazon online test format

2011-08-06 Thread Ankur Garg
@Yasir MCQ are of which types ??? Regards Ankur Garg On Sat, Aug 6, 2011 at 4:45 PM, Yasir wrote: > Earlier they had telephonic interview as first round but now this > online exam has become initial screening test. > Based on ur online test's performance they call for phonic round or on- > si

[algogeeks] Re: Directi Question

2011-08-06 Thread Dave
@Shady: There is a 1/2 probability of getting an even number on the first roll. In the 1/2 of the cases where the first roll is odd, roll again and note that there is a 1/2 chance of getting an odd number. Etc. The probability of needing n rolls is 1/2 to the nth power. The series is 1 + 2 * (1/2)

[algogeeks] Re: amazon online test format

2011-08-06 Thread Yasir
Almost same. For big probs, they don't ask for running code. Only pseudo-code is enough. On Aug 6, 9:42 pm, Ankur Garg wrote: > The questions in the link are quite decent...Is the toughness level of > Amazon test same or more ? > > > > > > > > On Sat, Aug 6, 2011 at 11:47 AM, shady wrote: > > @n

[algogeeks] Re: amazon online test format

2011-08-06 Thread Yasir
Earlier they had telephonic interview as first round but now this online exam has become initial screening test. Based on ur online test's performance they call for phonic round or on- site interview. In online test, there there are 10 mcq questions and 5 coding probs. Cheers \o/ On Aug 6, 7:17 

Re: Re: [algogeeks] Re: adobe

2011-08-06 Thread Ashish Sachdeva
thanx mukul for explanation checked it randomly on 123.. it works fine... On Sat, Aug 6, 2011 at 11:27 PM, Ashish Sachdeva wrote: > mukul, pls explain my following doubts: > 1. whats the need of subtracting the numbers, like u subtracted 91 then 52 > etc... > 2. the ones digit 7 is ok... did

[algogeeks] SPOJ ABCD

2011-08-06 Thread Amol Sharma
i attempted a problem http://www.spoj.pl/problems/ABCD/ my logic is scan the input string and record the count of A, B, C, D in array of size 4 now sort the count array in the output array at first position put an element from count array whose count is less than n and not equal to elem

[algogeeks] Re: address calculation

2011-08-06 Thread rShetty
@all : I Think the output depends on whether it is row major or column major representation in memory . Does he row major or column major representations matter in calculations above??? On Aug 6, 11:49 pm, aditi garg wrote: > oh @ akshay y ru doing 10x4??? 10 is the no of rows not th

Re: [algogeeks] address calculation

2011-08-06 Thread rajeev bharshetty
@aditi : I Think the output depends on whether it is row major or column major representation in memory . Does he row amjor or column On Sun, Aug 7, 2011 at 12:19 AM, aditi garg wrote: > oh @ akshay y ru doing 10x4??? 10 is the no of rows not the columns so it > shud be 15x3+4...and

Re: [algogeeks] xplanation plz

2011-08-06 Thread Jyoti Gupta
but how do they both point to same address location ?? On 7 August 2011 01:05, jagrati verma wrote: > thanku all. > > On Sun, Aug 7, 2011 at 12:58 AM, Debabrata Das > wrote: > > try this: > > const int a=54; > >int *p=(int *)&a; > >*p=100; > >printf("

Re: [algogeeks] Error in code?plz help...

2011-08-06 Thread Ram Chauhan
Lvalue assigment error. On Sat, Aug 6, 2011 at 4:05 PM, Rajesh Kumar wrote: > How to remove error in this code? > > #include > main() > { > int i=10,j=15; > if(i%2=j%3) > printf("\ncharacter"); > } > > -- > Regards > Rajesh Kumar > > > -- > You received this message because you are subscribed to

Re: [algogeeks] Re: GS on campus

2011-08-06 Thread Jyoti Gupta
no questions~ yet!!! On 7 August 2011 00:45, Nitish Garg wrote: > I was just telling not to post the schedule, posting questions was never > the problem. :) > > > On Sun, Aug 7, 2011 at 12:42 AM, gaurav kumar wrote: > >> @nitish i agree to your point of college policy. But think of the >> suppo

Re: [algogeeks] Re: wht does this error means

2011-08-06 Thread jagrati verma
i got it. On Sun, Aug 7, 2011 at 1:04 AM, TheMitraBoy wrote: > It usually happens when you copy some code from a website. Its not > visible in editors like Notepad++ and all. Open your code in an editor > like 'vi' ( 'vim' in Windows)  . There you can see the stray > characters and delete

Re: [algogeeks] xplanation plz

2011-08-06 Thread jagrati verma
thanku all. On Sun, Aug 7, 2011 at 12:58 AM, Debabrata Das wrote: > try this: > const int a=54; >        int *p=(int *)&a; >        *p=100; >        printf("%d\n",*p); >        printf("%x %x",p,&a); > > > > On Sun, Aug 7, 2011 at 12:28 AM, UTKARSH SRIVASTAV > wrote: >> yes sa

[algogeeks] Re: wht does this error means

2011-08-06 Thread TheMitraBoy
It usually happens when you copy some code from a website. Its not visible in editors like Notepad++ and all. Open your code in an editor like 'vi' ( 'vim' in Windows) . There you can see the stray characters and delete it. On Aug 6, 10:57 pm, jagrati verma wrote: > error: stray ‘\342’ in progra

Re: [algogeeks] xplanation plz

2011-08-06 Thread Debabrata Das
try this: const int a=54; int *p=(int *)&a; *p=100; printf("%d\n",*p); printf("%x %x",p,&a); On Sun, Aug 7, 2011 at 12:28 AM, UTKARSH SRIVASTAV wrote: > yes saurabh the value of a has not changed > > On Sat, Aug 6, 2011 at 11:20 AM, aditi garg > wrote: >> >> @sa

Re: [algogeeks] Directi Question

2011-08-06 Thread mohit verma
(for first outcome odd) 1/6 * 3/6 + (for first outcome even) 1/6 * 3/6 = 1/6 so expected 6 cases. On Sat, Aug 6, 2011 at 8:04 PM, shady wrote: > Hi, > > A fair dice is rolled. Each time the value is noted and running sum is > maintained. What is the expected number of runs needed so that the su

Re: [algogeeks] Re: GS on campus

2011-08-06 Thread Nitish Garg
I was just telling not to post the schedule, posting questions was never the problem. :) On Sun, Aug 7, 2011 at 12:42 AM, gaurav kumar wrote: > @nitish i agree to your point of college policy. But think of the > support/help which we can get through u guys in advance for a > particular company.

[algogeeks] Re: GS on campus

2011-08-06 Thread gaurav kumar
@nitish i agree to your point of college policy. But think of the support/help which we can get through u guys in advance for a particular company. even u people of dce also need this . I request u to post as much questions of interview/written on this platform. it is really helpful. On Aug 7, 12:

Re: [algogeeks]

2011-08-06 Thread rahul rai
http://www.rrsd.com/software_development/postmans_sort/cuj/cuj.htm On 8/5/11, Gaurav Menghani wrote: > I agree with Dilip. It depends upon what type of input you have at hand. > > - Suppose you have an array having a million elements, where the > elements are in the range 1-3, counting sort would

Re: [algogeeks] GS on campus

2011-08-06 Thread Nitish Garg
It's against the Placement Policy to post the schedule of the companies visiting DCE. I am not against sharing the knowledge, its just that we should follow some rules related to the college. On Sun, Aug 7, 2011 at 12:30 AM, arvind kumar wrote: > @nitish:wats wrong in doing so?the whole point of

[algogeeks] Re: Radix sort in linear time???

2011-08-06 Thread Dave
@Kumar: Although it would be natural to use base 10 when you are using paper and pencil, you don't have to use base 10 to do your radix sort on a computer, where the numbers are stored internally in binary format. So use a base that is a power of 2 so that you can use a shift and a logical product

Re: [algogeeks] GS on campus

2011-08-06 Thread arvind kumar
@nitish:wats wrong in doing so?the whole point of a group is to share things..n this is not a thing thats not supposed to be shared. On Sun, Aug 7, 2011 at 12:26 AM, Nitish Garg wrote: > @Shashank @Sameer > Please do not post the schedule of the companies that are going to visit > the campus. > >

Re: [algogeeks] xplanation plz

2011-08-06 Thread UTKARSH SRIVASTAV
yes saurabh the value of a has not changed On Sat, Aug 6, 2011 at 11:20 AM, aditi garg wrote: > @saurabh > http://ideone.com/J0gNi > its jst pointing to same address bt it has not modified the value...chk the > abv link... > > On Sat, Aug 6, 2011 at 8:13 PM, saurabh singh wrote: > >> >> http://i

Re: [algogeeks] GS on campus

2011-08-06 Thread Nitish Garg
@Shashank @Sameer Please do not post the schedule of the companies that are going to visit the campus. -- 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/-/Y_ph

Re: [algogeeks] address calculation

2011-08-06 Thread aditi garg
oh @ akshay y ru doing 10x4??? 10 is the no of rows not the columns so it shud be 15x3+4...and by multiplying by 4(in 10x4) ur taking it to the 5th row ie A[4][4] its only A[3][4]... i hope its clear now On Sun, Aug 7, 2011 at 12:14 AM, akshay khatri wrote: > > > On 6 August 2011 23:56, adit

[algogeeks] Re: Intersection of 2 rectangles

2011-08-06 Thread Dave
@Immanuel: First, TopLeft and BottomRight or the alternative are insufficient to specify non-axis-aligned rectangles. Second, what we can say is that if the rectangles overlap then the shadows will overlap, but we cannot say that if the shadows overlap then the rectangles overlap; e.g., take the r

Re: [algogeeks] address calculation

2011-08-06 Thread akshay khatri
On 6 August 2011 23:56, aditi garg wrote: > @akshay: what i meant ws suppose the array strted from in decimal...so > A[3][4] wud be at 0049 and B[3][4] will be at 0196 > convert dese 2 values to hex it gives 31 and C4 respectively...now base > address is 1000 and 2000 instead if so add

Re: [algogeeks] Directi Question

2011-08-06 Thread Mukul Gupta
@Kunal: Perhaps, you are right :) On Sat, Aug 6, 2011 at 11:45 PM, Kunal Yadav wrote: > According to me if we get even number in first case then the series will > end there only as we just need an even sum. Similarly in case of e(3) the > only possible sequence for which the sum is even in exact

Re: [algogeeks] Re: Tug of War

2011-08-06 Thread UTKARSH SRIVASTAV
My accepted solution is this and I have told you my logic #include struct node { int data; int add; struct node *next; }*front,*rear; int flag,c; int fun(int item) { struct node *temp,*temp2,*r,*p,*q; int k,i; r=(struct node*)malloc(sizeof(struct node));

Re: [algogeeks] Re: sizeof structure

2011-08-06 Thread rajeev bharshetty
So Basically I drew this conclusion ( Correct if I am wrong) On Gcc char 1 byte but allocates 4 bytes padding 3 bytes for performance improvement. 4 double 8 bytes allocates 8 bytes ( multiple of 4 so no probs no padding) 8 int 4 bytes allocates 4 bytes. 4 -

Re: [algogeeks] Header Files

2011-08-06 Thread aditi garg
Thanks a lot :) On Sat, Aug 6, 2011 at 11:53 PM, ankit sambyal wrote: > yeah Siddarath's point is correct that they do hv preprocessors to prevent > multiple includes. And they would be using #ifndef instead of #pragma as it > is not a documented standard > > -- > You received this message becaus

Re: [algogeeks] address calculation

2011-08-06 Thread aditi garg
@akshay: what i meant ws suppose the array strted from in decimal...so A[3][4] wud be at 0049 and B[3][4] will be at 0196 convert dese 2 values to hex it gives 31 and C4 respectively...now base address is 1000 and 2000 instead if so add the base address and u get the ans 1031 and 20C4...i

Re: [algogeeks] wht does this error means

2011-08-06 Thread siddharth srivastava
On 6 August 2011 23:27, jagrati verma wrote: > error: stray ‘\342’ in program > just to add: it can also be due to single quotes If you have copied code from some site having fancy styling, it can be a reason for the error > > -- > You received this message because you are subscribed to the Goo

Re: [algogeeks] Header Files

2011-08-06 Thread ankit sambyal
yeah Siddarath's point is correct that they do hv preprocessors to prevent multiple includes. And they would be using #ifndef instead of #pragma as it is not a documented standard -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to thi

Re: [algogeeks] Re: Microsoft :)

2011-08-06 Thread Harshal
@ KK, congrats man!! awesome. :) @ Anuj, it's Microsoft IDC, and package offered is 16 lacs in India or 65 lacs in US. Choice was ours. Infact, they were convincing us to take Redmond. I have written my experience on web for my friends to see, have a look at it if you are interested in the whole

Re: [algogeeks] xplanation plz

2011-08-06 Thread aditi garg
@saurabh http://ideone.com/J0gNi its jst pointing to same address bt it has not modified the value...chk the abv link... On Sat, Aug 6, 2011 at 8:13 PM, saurabh singh wrote: > > http://ideone.com/Wszkg > > On Sat, Aug 6, 2011 at 8:03 PM, jagrati verma > wrote: > >> how can modify constant varia

Re: [algogeeks] Rotate a 2-D matrix by 90 degree inplace.

2011-08-06 Thread vaibhav shukla
first transpose it now reverse colums if u want a clockwise rotation else reverse rows for anti clockwise rotation On Sat, Aug 6, 2011 at 11:48 PM, Algo Lover wrote: > Can anyone solve this problem without using extra matrix > > -- > You received this message because you are subscribed to the

Re: [algogeeks] address calculation

2011-08-06 Thread akshay khatri
On 6 August 2011 23:40, aditi garg wrote: > A[3][4] wud be in the 4th row...so strtung address of 4th row wud be > 46..and thn 4th element wud be at 49...similarly fr B 180 fr the frst 3 rows > + 16 fr the 4th elemnet so 196 > How does it start from 46 and 180 ? as per my knowledge, 0x1000 = 409

Re: [algogeeks] Header Files

2011-08-06 Thread siddharth srivastava
On 6 August 2011 23:28, aditi garg wrote: > I have read that to avoid multiple declaration error we write #pragma > once in header files or use #ifndef and #def to make sure that the > header file is included only once... > i tried running a prog in whch i included stdio.h thrice bt it dint gv >

[algogeeks] Rotate a 2-D matrix by 90 degree inplace.

2011-08-06 Thread Algo Lover
Can anyone solve this problem without using extra matrix -- 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...@goo

Re: [algogeeks] wht does this error means

2011-08-06 Thread rajeev bharshetty
I think you copied and pasted the code from some resource and then tried to compile it. The error shown above are usually "smart quotes" they are shown usually when there is problem with the double quotation marks in the program (printf) So to remove that error, remove the double quotation marks i

Re: [algogeeks] Directi Question

2011-08-06 Thread Kunal Yadav
According to me if we get even number in first case then the series will end there only as we just need an even sum. Similarly in case of e(3) the only possible sequence for which the sum is even in exactly 3 turns is odd then even and then odd. On Sat, Aug 6, 2011 at 11:40 PM, Mukul Gupta wrote:

[algogeeks] Re: amazon online test format

2011-08-06 Thread nivedita arora
@shady- yes On Aug 6, 9:42 pm, Ankur Garg wrote: > The questions in the link are quite decent...Is the toughness level of > Amazon test same or more ? > > > > > > > > On Sat, Aug 6, 2011 at 11:47 AM, shady wrote: > > @nivedita this is for job right ? > > > On Sat, Aug 6, 2011 at 9:14 PM, nivedit

Re: [algogeeks] Re: Tug of War

2011-08-06 Thread Amol Sharma
anyone plz give hint how to solve this problem !! -- Amol Sharma Third Year Student Computer Science and Engineering MNNIT Allahabad On Sat, Aug 6, 2011 at 2:53 PM, Amol Sharma wrote: > http://www.spoj.pl/SPOJ/problems/TUG/ > > earlier i thought it would be easy to do it knapsack...but when

Re: [algogeeks] address calculation

2011-08-06 Thread aditi garg
A[3][4] wud be in the 4th row...so strtung address of 4th row wud be 46..and thn 4th element wud be at 49...similarly fr B 180 fr the frst 3 rows + 16 fr the 4th elemnet so 196 On Sat, Aug 6, 2011 at 11:37 PM, akshay khatri wrote: > how is that 49 bytes and 196 bytes > shouldn't it be 44 and 176

Re: [algogeeks] size -------

2011-08-06 Thread siddharth srivastava
On 6 August 2011 23:27, Nitin wrote: > I am also getting 24 bytes but y it is taking it every data type as 8,8,8 > as if we take it alone it is 1 for char and 4 for int and 8 for doble as it > is giving 24 which means it is setting every data type as 8 bytes. > it should be due to 64 bit machine

Re: [algogeeks] Directi Question

2011-08-06 Thread Mukul Gupta
E(x)= 1 x (1/2) + 2 x (1/2 x 1/2 (Odd-Odd) + 1/2 x 1/2 (Even-Even) + 3 (1/4 x 1/2 (Odd-Odd-Even)+ 1/4 x 1/2 (Odd-Even-Odd)+ 1/4 x 1/2 (Even-Odd-Odd)+ 1/4 x 1/2(Even-Even-Even) )+ E(x)= 1/2 + 1 + 3/2 . According to me, since the series does not converge, Expectation value does not exist. @K

Re: [algogeeks] Re: Duplicates in a string

2011-08-06 Thread hary rathor
than we can make a make bit set for keep track. only require one bit per character. we can track 256 character by just 256/32 =8 integer . i think that is sufficient for c language. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to

Re: [algogeeks] address calculation

2011-08-06 Thread akshay khatri
how is that 49 bytes and 196 bytes shouldn't it be 44 and 176 bytes respectively On 6 August 2011 23:26, Ram Chauhan wrote: > 1049 and 1098 > > On Sat, Aug 6, 2011 at 11:09 PM, aditi garg wrote: > >> CHAR A[10][15] AND INT B[10][15] IS DEFINED >> WHAT'S THE ADDRESS OF A[3][4] AND B[3][4] >> IF A

[algogeeks] finding triplets

2011-08-06 Thread coder dumca
given an array , find three numbers a,b and c such that a^2+b^2=c^2 in o(n^2) -- 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 a

Re: [algogeeks] Directi Question

2011-08-06 Thread 0_0
I think this is correct. -- 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/-/5gZRPfLAwNYJ. To post to this group, send email to algogeeks@googlegroups.com. To u

[algogeeks] Header Files

2011-08-06 Thread aditi garg
I have read that to avoid multiple declaration error we write #pragma once in header files or use #ifndef and #def to make sure that the header file is included only once... i tried running a prog in whch i included stdio.h thrice bt it dint gv any error...does dat mean we have #pragma once in ever

Re: [algogeeks] Re: sizeof structure

2011-08-06 Thread vikas singh
@sandeep I have executed it on gcc, it's showing 16 bytes(earlier post, the address too) ... I'm sure now, this thing is PURILY compiler dependent.. and it's your code buddy, not mine. ;) On Sat, Aug 6, 2011 at 7:37 PM, SANDEEP CHUGH wrote: > > i hav executed ur code on dev c++.. i m getting c

Re: [algogeeks] size -------

2011-08-06 Thread Nitin
I am also getting 24 bytes but y it is taking it every data type as 8,8,8 as if we take it alone it is 1 for char and 4 for int and 8 for doble as it is giving 24 which means it is setting every data type as 8 bytes. On Sat, Aug 6, 2011 at 9:28 PM, Aditya Virmani wrote: > i guess it depends on ur

[algogeeks] wht does this error means

2011-08-06 Thread jagrati verma
error: stray ‘\342’ in program -- 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 op

  1   2   3   4   >