Re: [algogeeks] Math Quiz

2011-08-21 Thread Vinuta J
Hey, can u pls explain the 1st statement.. 4*f(OED)=f(OBC) --- from similarity ? Y is it 4 times?? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit

Re: [algogeeks]

2011-08-21 Thread muthu raj
Segregate the Odd and even nodes in the list by traversing in O(n). Then print the resulting list in O(n). So no additional space required and solution in O(n) time also :) *Muthuraj R IV th Year , ISE PESIT , Bangalore* On Fri, Aug 19, 2011 at 9:48 AM, priya ramesh

Re: [algogeeks] sol

2011-08-21 Thread Puneet Chawla
If a,b are not equal then this statement will always return true status as a^b=true so true bit-wise or-ed with anyone will return true. On Sun, Aug 21, 2011 at 10:38 AM, SHUBHAM BANSAL shubham.bans...@gmail.comwrote: ((a^b) | ((ab)1)) sorry tht was bitwise or..by mistak i hd wrote logicl or

Re: [algogeeks] Math Quiz

2011-08-21 Thread Greeshma
hey how is area of ECD = 6? EC is not a diagonal so its not 6 -- 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/-/rFxNlxmIHoUJ. To post to this group, send email

Re: [algogeeks] Re: Puzzle

2011-08-21 Thread Puneet Chawla
only M is married. On Sat, Aug 20, 2011 at 7:53 PM, Arun Vishwanathan aaron.nar...@gmail.comwrote: @DK:if L is married to M according to you finally , then what does the third if then statement according to you mean when it is given that if L is not married then M is married? On Fri, Aug

Re: [algogeeks] Math Quiz

2011-08-21 Thread Greeshma
hey got it! the ans s 2 :) -- 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/-/r4I_8-_6hy8J. To post to this group, send email to algogeeks@googlegroups.com. To

Re: [algogeeks] Challenge

2011-08-21 Thread Sanjay Rajpal
see array is sorted when all zeros occur before 1s in each row. Now see ur input. My algo will work only for sorted array. On 8/20/11, rashmi i rash...@gmail.com wrote: will your solution work for: 0001 0010 0100 0110 1000 On Sun, Aug 21, 2011 at 10:29 AM, sachin sabbarwal

Re: [algogeeks] c++

2011-08-21 Thread Sanjay Rajpal
I think it will not be an error. This is because X() will create a temporary object, and when the object is returned in the function calling it, then default copy constructor will do bitwise copy of data members in the calling function. Correct me if m wrong. On 8/20/11, sachin sabbarwal

Re: [algogeeks] c++

2011-08-21 Thread Puneet Chawla
It will show error On Sun, Aug 21, 2011 at 12:21 PM, Sanjay Rajpal srn...@gmail.com wrote: I think it will not be an error. This is because X() will create a temporary object, and when the object is returned in the function calling it, then default copy constructor will do bitwise copy of

Re: [algogeeks] c++

2011-08-21 Thread Abhishek Yadav
But if you try making a copy constructor of your own and check whether it is called or not.it does not. On Sun, Aug 21, 2011 at 12:21 PM, Sanjay Rajpal srn...@gmail.com wrote: I think it will not be an error. This is because X() will create a temporary object, and when the object is

Re: [algogeeks] apti

2011-08-21 Thread Tushar Bindal
if the cyclist would have left on time, then in those 20 minutes, he would have covered 4miles at a speed of 12miles/h so he would have been 1 mile before station whereas train would have been 5 miles before as it is on its normal time, so no change in its position. then, when the cyclist covers

[algogeeks] plzzzzzzzzzzz

2011-08-21 Thread jagrati verma
techendeavour is abt to visiting so plz share some info.. abt written or interview. -- 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

Re: [algogeeks]

2011-08-21 Thread sukran dhawan
u mean dutch algorithm ? On Sun, Aug 21, 2011 at 11:31 AM, muthu raj muthura...@gmail.com wrote: Segregate the Odd and even nodes in the list by traversing in O(n). Then print the resulting list in O(n). So no additional space required and solution in O(n) time also :) *Muthuraj R IV th

[algogeeks]

2011-08-21 Thread Puneet Chawla
class base { public: int bval; base(){bval=0;} }; class deri:public base { public: int dval; deri(){dval=1;} }; void SomeFunc(base *arr,int size) { for(int i=0; isize; i++,arr++) coutarr-bval;

Re: [algogeeks] apti

2011-08-21 Thread prasanth n
@tushar: thanks On Sun, Aug 21, 2011 at 12:27 PM, Tushar Bindal tushicom...@gmail.comwrote: if the cyclist would have left on time, then in those 20 minutes, he would have covered 4miles at a speed of 12miles/h so he would have been 1 mile before station whereas train would have been 5

Re: [algogeeks] c++

2011-08-21 Thread Abhishek Yadav
The code is correct..return X will make a temporary object and for that a constructor and corresponding destructor will be called and that object is returned. On Sun, Aug 21, 2011 at 12:24 PM, Puneet Chawla puneetchawla...@gmail.comwrote: It will show error On Sun, Aug 21, 2011 at 12:21 PM,

Re: [algogeeks]

2011-08-21 Thread Naman Mahor
because the pointer of base class will move by 2 bytes every time but the size of derived class is 4 byte. On Sun, Aug 21, 2011 at 12:31 PM, Puneet Chawla puneetchawla...@gmail.comwrote: class base { public: int bval; base(){bval=0;} }; class

Re: [algogeeks] Re: Search an array of unknown length

2011-08-21 Thread saurabh singh
kkk...not sure assume no number is greater than 1000(I mentioned There has to be some additional constraints to make the problem solvable) Now check 1st element if not the desired element keep multiplying with 2 the previous range till either one of these condition is satisfied *1.An exception

Re: [algogeeks]

2011-08-21 Thread Puneet Chawla
Wil u please explain in context of o/p.means how 1 whn SomeFunc(DeriArr,5); stmt is executed how 0 and 1 will come..??? On Sun, Aug 21, 2011 at 12:40 PM, Naman Mahor naman.ma...@gmail.com wrote: because the pointer of base class will move by 2 bytes every time but the size of derived class is

Re: [algogeeks]

2011-08-21 Thread Naman Mahor
#includeiostream using namespace std; class base { public: int bval; base(){bval=0;} }; class deri:public base { public: int dval; deri(){dval=1;} }; void SomeFunc(base *arr,int size) { for(int i=0;

Re: [algogeeks] c++

2011-08-21 Thread JAIDEV YADAV
dude u haven't used copy constructor properly .. check it out again ... you are not copying actually ... thats it ... On Sun, Aug 21, 2011 at 12:53 PM, Abhishek Yadav algowithabhis...@gmail.com wrote: Check this code: the thing i couldn't understand is when the object is being returned

Re: [algogeeks]

2011-08-21 Thread Sanjay Rajpal
@Naman : Can you tell me why the value of dval is accessed via bval of base class ? I got ur point but still confused about it. Sanju :) On Sun, Aug 21, 2011 at 12:16 AM, Naman Mahor naman.ma...@gmail.com wrote: #includeiostream using namespace std; class base {

Re: [algogeeks] c++

2011-08-21 Thread Abhishek Yadav
what are you trying to say?...can you please explain? On Sun, Aug 21, 2011 at 1:35 PM, JAIDEV YADAV jaid...@gmail.com wrote: try to use X b = a ; b.fun() ; On Sun, Aug 21, 2011 at 1:33 PM, Abhishek Yadav algowithabhis...@gmail.com wrote: ok...may be i forgot , can you please tell me

Re: [algogeeks] array problem

2011-08-21 Thread Dheeraj Sharma
while(a) ( a=(a-1) count++ ) counts number of 1s in number 'a'.. Loop can be breaken if count exceeds 16.. On 8/21/11, himanshu kansal himanshukansal...@gmail.com wrote: problem: There is an array containing integers. for every bit in the integer,you have to print a 1 if no of 1s

Re: [algogeeks] array problem

2011-08-21 Thread Puneet Chawla
Similary as we are counting set bits count 0's nd cmpare nd set 1 if coutn(1)count(0) for each integer in array On Sun, Aug 21, 2011 at 1:44 PM, Sanjay Rajpal srn...@gmail.com wrote: @Dheeraj : I think u should review the problem again. What u have posted is a way to find no. of set bits in a

Re: [algogeeks] array problem

2011-08-21 Thread Dheeraj Sharma
yeah i took it in the another way..i ll post it v soon On 8/21/11, himanshu kansal himanshukansal...@gmail.com wrote: problem: There is an array containing integers. for every bit in the integer,you have to print a 1 if no of 1s corresponding to that bit is more than no of 0s corresponding

Re: [algogeeks]

2011-08-21 Thread sukran dhawan
can u elobarate on ur algo ? its a singly linked circular list .so its diff to apply dutch method. On Sun, Aug 21, 2011 at 11:31 AM, muthu raj muthura...@gmail.com wrote: Segregate the Odd and even nodes in the list by traversing in O(n). Then print the resulting list in O(n). So no additional

Re: [algogeeks] sql help

2011-08-21 Thread jega...@gmail.com
Pls have a look at this site... sqlauthority.com On 21-Aug-2011 11:44 AM, sachin sabbarwal algowithsac...@gmail.com wrote: plz suggest some link where i can get questions on sql queries to practice. thanks in advance!! -- You received this message because you are subscribed to the Google

Re: [algogeeks] array problem

2011-08-21 Thread Sanjay Rajpal
let n be the no.of integers in the array : int i=1,a; int zero,one; for(int a=1;a=32;a++) { zero=0; one=0; for(int j=0;jn;j++) { if(a[j] i) { one++; } else {

[algogeeks] convert a vector containing octal representation of a number to decimal number

2011-08-21 Thread sarvesh saran
Hi, I have a vectorint A or an array (for C guys) that contains the octal representation of a number. So the array can be something like: [1,5,7] or [7,7,5,6,3,4,2] etc i.e no number in the array can be = 8. Now given this array, I need to convert it its decimal representation. The naive way

[algogeeks] Re: array problem

2011-08-21 Thread DheerajSharma
It would work i guess On Aug 21, 1:49 pm, Sanjay Rajpal srn...@gmail.com wrote: let n be the no.of integers in the array : int i=1,a;     int zero,one;     for(int a=1;a=32;a++)     {         zero=0;         one=0;         for(int j=0;jn;j++)         {             if(a[j] i)          

Re: [algogeeks] C-Question

2011-08-21 Thread Vijay Khandar
Can you explain me shortly how 5.375 is converted into normalised form...How to find mantissa and Exponent in this case? Plz Explain meVijay On Sun, Aug 21, 2011 at 1:25 PM, Rahul Tiwari rahultiwari6...@gmail.comwrote: On Sun, Aug 21, 2011 at 11:11 AM, Rahul Tiwari

Re: [algogeeks] array problem

2011-08-21 Thread sagar pareek
This problem can be reduced if we are taking whole 32 bits... Mean left most all 0's bits are also including then if number is less than 65535 (2^16-1) then make it 0 as 16 bits are at least zero in this case On Sun, Aug 21, 2011 at 2:19 PM, Sanjay Rajpal srn...@gmail.com wrote: let n be

Re: [algogeeks] array problem

2011-08-21 Thread Dheeraj Sharma
yeah bt..when we talk abt the complexity..we consider abt the worst case On 8/21/11, himanshu kansal himanshukansal...@gmail.com wrote: problem: There is an array containing integers. for every bit in the integer,you have to print a 1 if no of 1s corresponding to that bit is more than no

Re: [algogeeks] matrix

2011-08-21 Thread Dheeraj Sharma
complexity nd all? O(n^4) works? On 8/21/11, prasanth n nprasnt...@gmail.com wrote: given a matrix with +ve and -ve numbers, find the submatrix with maximum sum?? -- *prasanth* -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to

Re: [algogeeks]

2011-08-21 Thread Dheeraj Sharma
if we take two pointers..one ahead of another initially..then jump one of the pointer twice..until it reaches the beginning(printing the valu) n similar for the another pointer does ptr-next-next means ha.f travelling the list? On 8/21/11, muthu raj muthura...@gmail.com wrote: Segregate the Odd

Re: [algogeeks]

2011-08-21 Thread Dheeraj Sharma
if we take two pointers..one ahead of another initially..then jump one of the pointer twice..until it reaches the beginning(printing the valu) n similar for the another pointer does ptr-next-next means ha.f travelling the list? On 8/21/11, muthu raj muthura...@gmail.com wrote: Segregate the Odd

Re: [algogeeks] convert a vector containing octal representation of a number to decimal number

2011-08-21 Thread Nitin Nizhawan
int num = 0; for(int i=0;iA.size();i++){ num=num||(A[i]3*i); } printf(%d,num); I think this will do. On Sun, Aug 21, 2011 at 2:25 PM, sarvesh saran aquarian.thun...@gmail.comwrote: Hi, I have a vectorint A or an array (for C guys) that contains the octal representation of a number. So

Re: [algogeeks] convert a vector containing octal representation of a number to decimal number

2011-08-21 Thread Nitin Nizhawan
int num = 0; for(int i=0;iA.size();i++){ num=num||(A[i]3*i); } printf(%d,num); I think this will do. Given the number is with in the range of integer. On Sun, Aug 21, 2011 at 3:40 PM, Nitin Nizhawan nitin.nizha...@gmail.comwrote: int num = 0; for(int i=0;iA.size();i++){

[algogeeks] why the output 16

2011-08-21 Thread SuDhir mIsHra
#includestdio.h #define FUNC1(i) (i*(i-1)) #define FUNC2(i) (i==0?1:i*FUNC1(i-1)) main() { int i=8; printf(\n%d,FUNC2(i)); } -- 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] Re: DELOITTE

2011-08-21 Thread Udit Gupta
@somya can you plz explain...what do software engineering concepts hae to do with the gd round?? On Tue, Aug 16, 2011 at 7:47 PM, siva viknesh sivavikne...@gmail.comwrote: hi can u plz tell me in which areas of aps did they concentrate .. i mean the topics...work and time, probability ..like

Re: [algogeeks] c question what is output?

2011-08-21 Thread sagar pareek
FUNC2(i) = i==0?i*(i-1*(i-1-1)) 8==0?1:8*(8-1*(8-1-1)) 8==0?1:8*(8-6) 8==0?1:8*2 8==0?1:16 hence it will return 16 On Sun, Aug 21, 2011 at 11:40 AM, SuDhir mIsHra sudhir08.mis...@gmail.comwrote: #includestdio.h #define FUNC1(i) (i*(i-1)) #define FUNC2(i) (i==0?1:i*FUNC1(i-1)) main() {

Re: [algogeeks] why the output 16

2011-08-21 Thread Naman Mahor
8==0?1:8* (8-1*(8-1-1)) this will execute as 8*(8-1(8-2)) = 8*(8-1*6)8*(8-6)===8*2===16 On Sat, Aug 20, 2011 at 7:02 PM, SuDhir mIsHra sudhir08.mis...@gmail.comwrote: #includestdio.h #define FUNC1(i) (i*(i-1)) #define FUNC2(i) (i==0?1:i*FUNC1(i-1)) main() { int i=8;

Re: [algogeeks] c question what is output?

2011-08-21 Thread Sanjay Rajpal
+1 to sagar Sanju :) On Sun, Aug 21, 2011 at 3:26 AM, sagar pareek sagarpar...@gmail.com wrote: FUNC2(i) = i==0?i*(i-1*(i-1-1)) 8==0?1:8*(8-1*(8-1-1)) 8==0?1:8*(8-6) 8==0?1:8*2 8==0?1:16 hence it will return 16 On Sun, Aug 21, 2011 at 11:40 AM, SuDhir mIsHra

Re: [algogeeks] convert a vector containing octal representation of a number to decimal number

2011-08-21 Thread sarvesh saran
Hi Nitin, thanks that makes sense. I will try that out. I have another question. Is there a really fast way of converting a hexadecimal string say 02F9A to its decimal representation in C++? thanks, Sarvesh thanks, Sarvesh On Sun, Aug 21, 2011 at 3:41 PM, Nitin Nizhawan

Re: [algogeeks] why the output 16

2011-08-21 Thread Prakash D
FUNC2(8) == 8==0? 1: 8 * FUNC1(8-1) == 8==0? 1: 8*( 8-1* 8-1-1) == 8 * (8-8-2) == -16 but why 16?? On Sat, Aug 20, 2011 at 7:02 PM, SuDhir mIsHra sudhir08.mis...@gmail.comwrote: #includestdio.h #define FUNC1(i) (i*(i-1)) #define FUNC2(i) (i==0?1:i*FUNC1(i-1)) main() { int i=8;

Re: [algogeeks] why the output 16

2011-08-21 Thread Prakash D
got it 8==0? 1: 8*( 8 -1* 8-1-1) == 8*( 8 - {1* 8-1-1}) == 8 * (8-6) == 16 but why??? On Sun, Aug 21, 2011 at 4:03 PM, Prakash D cegprak...@gmail.com wrote: == 8==0? 1: 8*( 8-1* 8-1-1) -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To

Re: [algogeeks] why the output 16

2011-08-21 Thread sagar pareek
@prakash before posting u should check what others already posted :D :D On Sun, Aug 21, 2011 at 4:03 PM, Prakash D cegprak...@gmail.com wrote: FUNC2(8) == 8==0? 1: 8 * FUNC1(8-1) == 8==0? 1: 8*( 8-1* 8-1-1) == 8 * (8-8-2) == -16 but why 16?? On Sat, Aug 20, 2011 at 7:02 PM, SuDhir

Re: [algogeeks] convert a vector containing octal representation of a number to decimal number

2011-08-21 Thread Sanjay Rajpal
Hi your intention was logical OR or BITWISE OR ? u did Logical. Sanju :) On Sun, Aug 21, 2011 at 3:30 AM, sarvesh saran aquarian.thun...@gmail.comwrote: Hi Nitin, thanks that makes sense. I will try that out. I have another question. Is there a really fast way of converting a

Re: [algogeeks] why the output 16

2011-08-21 Thread Prakash D
:P.. no comments when i saw On Sun, Aug 21, 2011 at 4:07 PM, sagar pareek sagarpar...@gmail.com wrote: @prakash before posting u should check what others already posted :D :D On Sun, Aug 21, 2011 at 4:03 PM, Prakash D cegprak...@gmail.com wrote: FUNC2(8) == 8==0? 1: 8 * FUNC1(8-1) ==

Re: [algogeeks] why the output 16

2011-08-21 Thread Vijay Khandar
FUNC1(i) (i*(i-1))=so put i-1 as it is on i=so (i-1*(i-1-1)) and i=8 so(8-1*(8-1-1))=(8-1(6))=2 and mul bu 8=16 On Sun, Aug 21, 2011 at 4:03 PM, Prakash D cegprak...@gmail.com wrote: FUNC2(8) == 8==0? 1: 8 * FUNC1(8-1) == 8==0? 1: 8*( 8-1* 8-1-1) == 8 * (8-8-2) == -16 but why 16??

Re: [algogeeks] convert a vector containing octal representation of a number to decimal number

2011-08-21 Thread Prakash D
A[i]3*i why is it needed to convert from base 8 to base 10?? On Sun, Aug 21, 2011 at 4:07 PM, Sanjay Rajpal srn...@gmail.com wrote: Hi your intention was logical OR or BITWISE OR ? u did Logical. Sanju :) On Sun, Aug 21, 2011 at 3:30 AM, sarvesh saran aquarian.thun...@gmail.com

Re: [algogeeks] convert a vector containing octal representation of a number to decimal number

2011-08-21 Thread sarvesh saran
Hi Prakash, I'll paste the exact description of the problem: A non-empty array A of N elements contains octal representation of a non-negative integer K, i.e. each element of A belongs to the interval [0; 7] (both ends included). Write a function that returns the number of bits set to 1 in the

Re: [algogeeks] c question what is output?

2011-08-21 Thread Ayswarya Srinivasan
doesn it work like below ? func2(8)= 8 * func1(7) func1(7)= 7*6 so i=8*7*6??? On Sun, Aug 21, 2011 at 3:58 PM, Sanjay Rajpal srn...@gmail.com wrote: +1 to sagar Sanju :) On Sun, Aug 21, 2011 at 3:26 AM, sagar pareek sagarpar...@gmail.comwrote: FUNC2(i) = i==0?i*(i-1*(i-1-1))

Re: [algogeeks] c question what is output?

2011-08-21 Thread Sanjay Rajpal
Nopes, its a funda of PRE-PROCESSOR directives. Look before the object code is generated for the program, all the occurences of the MACROs are replaced with their expansions as such as in the definition. So what u r doing is completely wrong. For more info on MACROs, refer any text book of C.

[algogeeks] Re: c question what is output?

2011-08-21 Thread Anjul Sharma
is 336 the answer?? On Aug 21, 11:10 am, SuDhir mIsHra sudhir08.mis...@gmail.com wrote: #includestdio.h #define FUNC1(i) (i*(i-1)) #define FUNC2(i) (i==0?1:i*FUNC1(i-1)) main() {         int i=8;         printf(\n%d,FUNC2(i)); } -- You received this message because you are

Re: [algogeeks] Re: c question what is output?

2011-08-21 Thread Sanjay Rajpal
16 8*(8-1*(8-1-1)) Sanju :) On Sun, Aug 21, 2011 at 4:10 AM, Anjul Sharma annurocks1...@gmail.comwrote: is 336 the answer?? On Aug 21, 11:10 am, SuDhir mIsHra sudhir08.mis...@gmail.com wrote: #includestdio.h #define FUNC1(i) (i*(i-1)) #define FUNC2(i) (i==0?1:i*FUNC1(i-1)) main()

Re: [algogeeks] Re: c question what is output?

2011-08-21 Thread sagar pareek
Arey yaar just see the my post... i explained it step by step :) On Sun, Aug 21, 2011 at 4:43 PM, Sanjay Rajpal srn...@gmail.com wrote: 16 8*(8-1*(8-1-1)) Sanju :) On Sun, Aug 21, 2011 at 4:10 AM, Anjul Sharma annurocks1...@gmail.comwrote: is 336 the answer?? On Aug 21, 11:10 am,

Re: [algogeeks] C-Question

2011-08-21 Thread Abhishek
check this link.. http://en.wikipedia.org/wiki/Single_precision_floating-point_format -- 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/-/OTIkO_pXQMgJ. To post

Re: [algogeeks] Re: DELOITTE

2011-08-21 Thread somya mishra
like user interface design etc On Sat, Aug 20, 2011 at 10:06 AM, Udit Gupta uditgupta...@gmail.com wrote: @somya can you plz explain...what do software engineering concepts hae to do with the gd round?? On Tue, Aug 16, 2011 at 7:47 PM, siva viknesh sivavikne...@gmail.comwrote: hi can u

Re: [algogeeks] Re: Puzzle

2011-08-21 Thread rahul aravind
consider the last two cases N married L not married L not married M married so now tak M and N compare it with first case M married N not married therfore,only m married On Sun, Aug 21, 2011 at 1:06 PM, Tushar Bindal tushicom...@gmail.comwrote: @arun if L is not married, then M must be

Re: [algogeeks] Google Question:Given a BST and a number, Find the closest node to that number in the BST.

2011-08-21 Thread rahul aravind
@Abhishek:nice algo dude.. On Sat, Aug 20, 2011 at 12:56 PM, Abhishek Yadav algowithabhis...@gmail.com wrote: Hey i tried it now and got to another solution O(log n) solution: 1. try searching for the number , if found,return the node, otherwise, you will ultimately reach a leaf node say

Re: [algogeeks] Re: c question what is output?

2011-08-21 Thread Dipankar Patro
+1 to 16. whats the confusion here? On 21 August 2011 16:44, sagar pareek sagarpar...@gmail.com wrote: Arey yaar just see the my post... i explained it step by step :) On Sun, Aug 21, 2011 at 4:43 PM, Sanjay Rajpal srn...@gmail.com wrote: 16 8*(8-1*(8-1-1)) Sanju :) On Sun, Aug

Re: [algogeeks] c++

2011-08-21 Thread Jagannath Prasad Das
Copy constructor should have been called two times!!1 On Sun, Aug 21, 2011 at 1:38 PM, Abhishek Yadav algowithabhis...@gmail.comwrote: what are you trying to say?...can you please explain?h On Sun, Aug 21, 2011 at 1:35 PM, JAIDEV YADAV jaid...@gmail.com wrote: try to use X b = a ;

Re: [algogeeks] C-Question

2011-08-21 Thread Vijay Khandar
Thank u very much Abhishek for this link, Now I got it ...But also u explain me in following.. 5.375 is represents 0100 1010 1100 means 4 0 A C 0 0 0 0in Hex now how it prints 00 00 AC 40 means can it accepts fm right to left or L to R I m little

Re: [algogeeks] c++

2011-08-21 Thread priya ramesh
it is not an error. check this code: I compiled it #includeiostream using namespace std; class X { public: X() { } }; main(){ } X fun() { return X(); } -- 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] C-Question

2011-08-21 Thread Puneet Chawla
Compiler is little endian so as u have typecasted it to char pointer then 0100 1010 1100 means 4 0 A C 0 0 0 0 it will show o/p byte by byte from LSB. On Sun, Aug 21, 2011 at 5:47 PM, Vijay Khandar vijaykhand...@gmail.comwrote: Thank u very much Abhishek for this link,

Re: [algogeeks] C-Question

2011-08-21 Thread Puneet Chawla
forgot to mention last byte 00 then 2nd last 00 and so on AC then 40 On Sun, Aug 21, 2011 at 6:00 PM, Puneet Chawla puneetchawla...@gmail.comwrote: Compiler is little endian so as u have typecasted it to char pointer then 0100 1010 1100 means 4 0 A C 0 0 0 0 it will

Re: [algogeeks] C-Question

2011-08-21 Thread Vijay Khandar
I was thinking the same ..byte by byte from R to L thank u very muchNow i have got it..On Sun, Aug 21, 2011 at 6:01 PM, Puneet Chawla puneetchawla...@gmail.com wrote: forgot to mention last byte 00 then 2nd last 00 and so on AC then 40 On Sun, Aug 21, 2011 at 6:00 PM,

Re: [algogeeks] C-Question

2011-08-21 Thread Vijay Khandar
Thanks puneet ... On Sun, Aug 21, 2011 at 6:01 PM, Puneet Chawla puneetchawla...@gmail.comwrote: forgot to mention last byte 00 then 2nd last 00 and so on AC then 40 On Sun, Aug 21, 2011 at 6:00 PM, Puneet Chawla puneetchawla...@gmail.comwrote: Compiler is little endian so as

Re: [algogeeks] AMAZON

2011-08-21 Thread aditya kumar
thnks all . yeah sure will post the questions :) On Sat, Aug 20, 2011 at 4:29 PM, Akash Mukherjee akash...@gmail.com wrote: @aditya - basic os networking, ds - esp trees(esp bsts) algo if needed, refer cracking the coding interview. do post the questions asked once its over :) On Sat,

Re: [algogeeks] Math Quiz

2011-08-21 Thread Jagannath Prasad Das
A(OED)=1/4 A(OCB) from similarity area relationship A(OED)+A(ODC)=6; A(ODC)+A(OCB)=12; solve them A(OED)=2 sq units On Sun, Aug 21, 2011 at 12:06 PM, Greeshma greeshma.0...@gmail.com wrote: hey got it! the ans s 2 :) -- You received this message because you are subscribed to the Google

[algogeeks] amazon q

2011-08-21 Thread priya ramesh
A data structure is required for storing a set of integers such that each of the following operations can be done in (log n) time, where n is the number of elements in the set. Deletion of the smallest element Insertion of an element if it is not already present in the set Which of the following

Re: [algogeeks] Special String

2011-08-21 Thread vaibhavmittal11
Hint: It is a dp of the form f(n+3) = a*f(n+2) + b*f(n+1) + c*f(n) Figure a, b, c urself.. VM NSIT, Dwarka 3rd year, COE On , Amol Sharma amolsharm...@gmail.com wrote: Plz help me in solving a simple problem on spoj http://www.spoj.pl/problems/MAIN113/ i am not able to conclude a general

Re: [algogeeks] amazon q

2011-08-21 Thread priya ramesh
so which is the right option?? -- 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] amazon q

2011-08-21 Thread Akash Mukherjee
heap is true but i am not getting y we can't use a balanced binary tree searching for the smallest is logn(leftmost node), then deleting it is logn so, should it be both?? thanx :) On Sun, Aug 21, 2011 at 6:54 PM, sukran dhawan sukrandha...@gmail.comwrote: its heap On Sun, Aug 21, 2011 at

[algogeeks]

2011-08-21 Thread code pool
Can anyone give me an example of big-endian compiler..??? -- 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] Directi Questions

2011-08-21 Thread navneet kumar
hi all, has Directi visited any of your campus?? if yes then can you share some details... Regards, Navneet Kumar -- Department of Information Technology, Indian Institute of Information Technology and Management Gwalior, MP, INDIA Contact no.:+91-9977935740 -- You received this message

[algogeeks] any good link?

2011-08-21 Thread MAC
can anyone suggest good link to review Algos and OS concepts -- thanks --mac -- 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] IMPORTANT: Success Factors

2011-08-21 Thread vartika
Does any one have any idea about the placement procedure of Success Factors? The kind of questions that they ask in the written test and/ or interview? Please reply.. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send

[algogeeks] Re: any good link?

2011-08-21 Thread Navneet
geeksforgeeks.org careercup.com On Aug 21, 7:13 pm, MAC macatad...@gmail.com wrote: can anyone suggest good link to review Algos and OS concepts -- thanks --mac -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send

[algogeeks] triangle numbers in an array

2011-08-21 Thread sarvesh saran
No idea how to solve the problem except the brute force O(n3) approach.I am looking for a better solution than this. Because of O(1) complexity you cannot copy and sort the input. A zero-indexed array A consisting of N integers is given. A triplet (P, Q, R) is triangular if and A[P] + A[Q]

Re: [algogeeks] triangle numbers in an array

2011-08-21 Thread Sanjay Rajpal
Simply sort the array and check for a[i]+a[i+1] a[i+2] for i=0 to n-3. Sanju :) On Sun, Aug 21, 2011 at 7:28 AM, sarvesh saran aquarian.thun...@gmail.comwrote: No idea how to solve the problem except the brute force O(n3) approach.I am looking for a better solution than this. Because of

Re: [algogeeks] triangle numbers in an array

2011-08-21 Thread sarvesh saran
Hi Sanjay, *Because of O(1) complexity you cannot copy and sort the input array. *thanks, Sarvesh* * On Sun, Aug 21, 2011 at 8:00 PM, Sanjay Rajpal srn...@gmail.com wrote: Simply sort the array and check for a[i]+a[i+1] a[i+2] for i=0 to n-3. Sanju :) On Sun, Aug 21, 2011 at 7:28 AM,

Re: [algogeeks] triangle numbers in an array

2011-08-21 Thread Sanjay Rajpal
By O(1) we mean that we can use variables, can't use something that equals size of the i/p array. Use Quick sort, sorting is done in-place which O(n log n) in time, and O(1) in space. Sanju :) On Sun, Aug 21, 2011 at 7:31 AM, sarvesh saran aquarian.thun...@gmail.comwrote: Hi Sanjay,

Re: [algogeeks] triangle numbers in an array

2011-08-21 Thread sarvesh saran
Hi Sanjay, The input is a constant vector. So it cannot be modified. Space requirement is O(1) so it cannot be copied. thanks, Sarvesh On Sun, Aug 21, 2011 at 8:04 PM, Sanjay Rajpal srn...@gmail.com wrote: By O(1) we mean that we can use variables, can't use something that equals size of the

[algogeeks] Doubt

2011-08-21 Thread Nikhil Gupta
http://www.ideone.com/kRaMj I found this in the algogeeks forum only. Can anyone explain how value of i is still 0, but *p shows 2 although their addresses are the same. -- Nikhil Gupta -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To

Re: [algogeeks] triangle numbers in an array

2011-08-21 Thread sarvesh saran
Hi Sanjay I think i forgot to mention that in my original post..so sorry about that. It is a constant array and should not be modified. thanks, Sarvesh On Sun, Aug 21, 2011 at 8:08 PM, sarvesh saran aquarian.thun...@gmail.comwrote: Hi Sanjay, The input is a constant vector. So it cannot

Re: [algogeeks] Re: any good link?

2011-08-21 Thread MAC
thanks .. any os specific ?? --mac On Sun, Aug 21, 2011 at 7:57 PM, Navneet navneetn...@gmail.com wrote: geeksforgeeks.org careercup.com On Aug 21, 7:13 pm, MAC macatad...@gmail.com wrote: can anyone suggest good link to review Algos and OS concepts -- thanks --mac -- You

Re: [algogeeks] Doubt

2011-08-21 Thread Ankur Khurana
can somebody please explain this ? On Sun, Aug 21, 2011 at 8:08 PM, Nikhil Gupta nikhilgupta2...@gmail.comwrote: http://www.ideone.com/kRaMj I found this in the algogeeks forum only. Can anyone explain how value of i is still 0, but *p shows 2 although their addresses are the same. --

Re: [algogeeks] triangle numbers in an array

2011-08-21 Thread sarvesh saran
Hi, I have posted this in stackoverflow. So you may choose to join here as well (this question was asked in an adobe written test) http://stackoverflow.com/questions/7138874/find-triangular-triplet-in-an-array thanks, Sarvesh On Sun, Aug 21, 2011 at 8:09 PM, sarvesh saran

Re: [algogeeks] Doubt

2011-08-21 Thread Kamakshii Aggarwal
But on dev c it is showing o/p as 2 2 .. I too have a doubt,a similar question was asked in atrenta's written paper. On Sun, Aug 21, 2011 at 8:14 PM, Ankur Khurana ankur.kkhur...@gmail.comwrote: can somebody please explain this ? On Sun, Aug 21, 2011 at 8:08 PM, Nikhil Gupta

Re: [algogeeks] triangle numbers in an array

2011-08-21 Thread Sanjay Rajpal
if u r saying i/p array can't be modified and complexity O(n logn)time and O(1) space, then i dont there exists any way to do that. if complexity is not the matter, then brute force way of three nested loops is the solution O(n^3) since here the original array will not be modified. Sanju :)

Re: [algogeeks] triangle numbers in an array

2011-08-21 Thread Sanjay Rajpal
after sorting the array, check if the sum of first two elements in sorted array is third element, if it is true, then all the conditions will hold, otherwise proceed with 2nd,3rd and 4th element. keep doing till u find a triplet, there u break out of the loop. Sanju :) On Sun, Aug 21, 2011 at

Re: [algogeeks] amazon q

2011-08-21 Thread Nikhil Gupta
Its both. Both can perform the operations in a maximum of O(logn) time. On Sun, Aug 21, 2011 at 7:13 PM, priya ramesh love.for.programm...@gmail.com wrote: i have the same doubt :) -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To

Re: [algogeeks] triangle numbers in an array

2011-08-21 Thread sarvesh saran
thanks a lot sanjay! will try that immediately. I have another problem to solve. It has a rather long description? Can I send you an email for it instead? thanks, Sarvesh On Sun, Aug 21, 2011 at 8:59 PM, Sanjay Rajpal srn...@gmail.com wrote: after sorting the array, check if the sum of first

[algogeeks] FIORANO

2011-08-21 Thread cdr
Has Fiorano come 4 recruitment anywhere...?Plz tell me abt the written test and interview process...thanks in advance -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit

[algogeeks] Re: another q on ds!

2011-08-21 Thread Dumanshu
first option is correct. Because we are not allowed to use any extra space. On Aug 21, 6:36 pm, priya ramesh love.for.programm...@gmail.com wrote: A Most efficient data structure is designed to optimize the following operations. Pop, Push, Min. The best possible time-complexities with no extra

Re: [algogeeks] SAP!!

2011-08-21 Thread Kamakshii Aggarwal
which college? On Sun, Aug 21, 2011 at 8:56 PM, rashmi i rash...@gmail.com wrote: Hey, SAP is visiting our college. Any idea about the pattern of the campus selection process? As in type of questions asked? Thanks -- R@$!-! DoN'T LimIt Ur cHaLlEngeS, ChAlLenGe uR LImItS. -- You

[algogeeks] Re: amazon q

2011-08-21 Thread Dumanshu
We can't use a heap. Balanced BST is correct because Deletion of the smallest element Insertion of an element if it is not already present in the set - for this we need to search for the element and searching in heap is O(n). On Aug 21, 6:16 pm, priya ramesh love.for.programm...@gmail.com wrote:

  1   2   3   >