Re: [algogeeks] DS representation.

2011-07-31 Thread rahul
I think it might help... struct node { int coef; /* A,B,C */ int var; /* x */ unsigned int exp;/* power of x */ struct node *next; /* next term in polynomial equation */ }; typedef struct node NODE; Regards. On Fri, Jul 29, 2011 at 7:32 PM, saurabh singh

Re: [algogeeks] DS representation.

2011-07-30 Thread saurabh singh
Once again I feel it boils down to the problem where the representation has to be used. If its a sparse polynomial(i dont think its a technichal term but i hope folks realize wat I want to say) link list is a gud idea. PS:MS visited our campus for interns(as well as for placements) and they were

[algogeeks] DS representation.

2011-07-29 Thread Puneet Gautam
Hi, pls tell me which data structure has following representation:: A+Bx+Cx(^2)+Dx(^3)+...+Nx(^n-1).?? reply asap...!! -- 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] DS representation.

2011-07-29 Thread Prem Krishna Chettri
SLL... Bit Field (best optimisation)... On Fri, Jul 29, 2011 at 3:06 PM, Puneet Gautam puneet.nsi...@gmail.comwrote: Hi, pls tell me which data structure has following representation:: A+Bx+Cx(^2)+Dx(^3)+...+Nx(^n-1).?? reply asap...!! -- You received this message because

Re: [algogeeks] DS representation.

2011-07-29 Thread sunny agrawal
Array that that stores A,B,C,D,E. it looks like u r on some telephonic interview :P On Fri, Jul 29, 2011 at 3:06 PM, Puneet Gautam puneet.nsi...@gmail.comwrote: Hi, pls tell me which data structure has following representation:: A+Bx+Cx(^2)+Dx(^3)+...+Nx(^n-1).?? reply

Re: [algogeeks] DS representation.

2011-07-29 Thread rajeev bharshetty
You can use a Hash map which maps the coefficients of the equation and their exponents. Is this feasible ?? On Fri, Jul 29, 2011 at 3:10 PM, sunny agrawal sunny816.i...@gmail.comwrote: Array that that stores A,B,C,D,E. it looks like u r on some telephonic interview :P On Fri, Jul 29,

Re: [algogeeks] DS representation.

2011-07-29 Thread Prem Krishna Chettri
For all Folks.. DS question answer cannot be simple yes no. it is always the tradeoff of Space and time Complexity. On Fri, Jul 29, 2011 at 3:26 PM, rajeev bharshetty rajeevr...@gmail.comwrote: You can use a Hash map which maps the coefficients of the equation and their exponents. Is this

Re: [algogeeks] DS representation.

2011-07-29 Thread Puneet Gautam
@sunny: well not really in an interview .. its that adobe is coming 1st august to our college.. I found this question in its placement papers..!!! I thought there might be a predefined ds for such representation... What is an SLL..? On 7/29/11, rajeev bharshetty rajeevr...@gmail.com wrote:

Re: [algogeeks] DS representation.

2011-07-29 Thread sunny agrawal
SLL = singly linked list but i think array is better choice :) On Fri, Jul 29, 2011 at 3:36 PM, Puneet Gautam puneet.nsi...@gmail.comwrote: @sunny: well not really in an interview .. its that adobe is coming 1st august to our college.. I found this question in its placement papers..!!! I