Suppose the number of shifts be x. Also let the integer be represented by 16 bits on that machine. Now take int n= (int)(x/16 + 0.5), to take the upper cap on result :) . SO having 2^x will be same as doing 2<<(x-1) so essentially if we represent the resultant number in a linked list of nodes, where each node can store an integer, then the bit position at 2+x-1=x+1 will be set as 1 and this (x+1)th nit will fall in (x+1)/16th node in linked list also in that node (x+1)%16 will give the position of bit to be set.
On Thu, Sep 2, 2010 at 1:32 PM, ashish agarwal <ashish.cooldude...@gmail.com > wrote: > I think it will be 1<<x > > > On Wed, Sep 1, 2010 at 10:53 PM, Yan Wang <wangyanadam1...@gmail.com>wrote: > >> Maybe you misunderstand the question. >> The question is how to compute 2^X where 00000 <= X <= 99999? >> How? >> >> On Wed, Sep 1, 2010 at 10:48 PM, Ruturaj <rutura...@gmail.com> wrote: >> > a 5 digit number is of order 10^5 which is << 10^16 of which int in C >> > is of size. >> > Just multiply both numbers. >> > >> > On Sep 2, 10:39 am, prasad rao <prasadg...@gmail.com> wrote: >> >> Program that takes a 5 digit number and calculates 2 power that number >> and >> >> prints it and should not use the Big-integer and Exponential >> Function's. >> > >> > -- >> > You received this message because you are subscribed to the Google >> Groups "Algorithm Geeks" group. >> > To post to this group, send email to algoge...@googlegroups.com. >> > To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com> >> . >> > For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > >> > >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algoge...@googlegroups.com. >> To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com> >> . >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> >> > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algoge...@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- Thanks & Regards, Saurabh -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.