On Sat, Aug 14, 2010 at 12:52 PM, AlgoBoy manjunath.n...@gmail.com wrote:
Add two numbers represented in a SLL. Each digit is represented as a
node...the length of the lists may be more than 2000...
Wat is the most efficient soln...store the added digits in another
SLL...and return the head
first reverse the both link list and than add
--
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
On 11 Aug, 23:54, Kishen Das kishen@gmail.com wrote:
http://www.telegraph.co.uk/science/science-news/7938238/Computer-scie...
Check out this cool news.
Kishen
On 10 Aug, 06:50, Niels Fröhling spamt...@adsignum.com wrote:
Up to date reactions, comments of the community/researchers
Most efficient algorithm to find all subsets of size K??
--
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
I am trying using fseek but somehow its not working?
--
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
Reversing the lists and then adding and then reversing the final list
is the most appropriate method. Bcoz the lists may contain
arbitarily large numbers, so forming integers then adding is not
logical here.
--
You received this message because you are subscribed to the Google Groups
can anyone suggest me lectures / videos for BASICS of BITS manipulation?
thanks in advance
Rahul K Rai
rahulpossi...@gmail.com
--
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.
http://graphics.stanford.edu/~seander/bithacks.html
http://graphics.stanford.edu/~seander/bithacks.htmlit has all that you
need.
On Sat, Aug 14, 2010 at 7:53 PM, rahul rai raikra...@gmail.com wrote:
can anyone suggest me lectures / videos for BASICS of BITS manipulation?
thanks in advance
Thanks a lot , it's a life saver , i will work it out fully .
2010/8/14, Asit Baran Das asitbaran@gmail.com:
http://graphics.stanford.edu/~seander/bithacks.html
http://graphics.stanford.edu/~seander/bithacks.htmlit has all that you
need.
On Sat, Aug 14, 2010 at 7:53 PM, rahul rai
explain ,if anybody known how to back tracking a Singly link list as a
Doubly list with XOR -operation or any method if implementation of a Doubly
link list using only one pointer .
Explain with help of example
--
You received this message because you are subscribed to the Google Groups
i think we can access numbers from last so no need to reverse it and also we
can store it in linke list in stack way so again no need to reverse the
linked list.
On Sat, Aug 14, 2010 at 7:03 PM, Gaurav Singh gogi.no...@gmail.com wrote:
Reversing the lists and then adding and then reversing the
how can you traverse from last without reversing it.
and there is no need fof using extra stack space.
--
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
I men to say ki just traverse from last instead of reversing it and storing
result in a stack in linked list form so that we dont need to reverse
again.Hope,i made myself clear.
On Sat, Aug 14, 2010 at 11:40 PM, Lokesh Agarwal lokesh...@gmail.comwrote:
how can you traverse from last without
Reversing and then again reversing the answer will not be an efficient
algorithm...
on the fly computation of sum must be done...any ideas
On 8/14/10, Rahul Singhal nitk.ra...@gmail.com wrote:
I men to say ki just traverse from last instead of reversing it and storing
result in a stack in
Part 1 of the trick is that if you know A xor B and you have either A
or B, you can get the other value. This is because A xor (A xor B) =
B and B xor (A xor B) = B.
[Incidentally, you can use subtraction rather than XOR. If you know A
- B and have A, you can compute A - (A - B) to get B. If
On 13 Aug, 17:05, Chonku cho...@gmail.com wrote:
Start with number 1. It will have a binary representation of 00...1 (Total
of n-bits)
Keeping adding 1 to it until you reach a number with all 1's in its binary
representation.
Looks correct to me,
here is a small implementation
Tail by default displays last 10 lines of file.
1. mmap the file
2. keep two pointers(A, B) pointing to beginning of the file
2. search for 10th \n using B, if not found i.e file has less than
10 lines, print from beginning to end
3. if found, start incrementing both A and B to the next \n.
http://rjlipton.wordpress.com/2010/08/12/fatal-flaws-in-deolalikars-proof/
Looks like there are serious flaws with this proof but it can produce other
interesting results.
http://rjlipton.wordpress.com/2010/08/12/fatal-flaws-in-deolalikars-proof/
Kishen
On Sat, Aug 14, 2010 at 7:30 AM,
i think we can use recursion method to reverse the list
-- Prashant Kulkarni
On Sat, Aug 14, 2010 at 11:40 PM, Lokesh Agarwal lokesh...@gmail.comwrote:
how can you traverse from last without reversing it.
and there is no need fof using extra stack space.
--
You received this message
write a program to shuffle an pack of cards in the most efficient way.
--
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
for(i=0;i52;++i)
{
int r=rand()%52;
swap(a[i],a[r]);
}
On Sat, Aug 14, 2010 at 11:46 PM, amit amitjaspal...@gmail.com wrote:
write a program to shuffle an pack of cards in the most efficient way.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks
@Sharad: Your code does not produce equally probable shuffles. You can
see this by noting that a[0] is swapped with one of 52 cards, same for
a[1], a[2], ..., a[51]. Thus, there are 52^52 possible sets of swaps.
But there are only 52! possible outcomes, and 52^52 / 52! is not an
integer.
You can
Tail works on stdin, too. Can't mmap that. The usual way is to
buffer the last N lines read in a ring buffe.r
On Aug 14, 4:22 pm, Prem Mallappa prem.malla...@gmail.com wrote:
Tail by default displays last 10 lines of file.
1. mmap the file
2. keep two pointers(A, B) pointing to beginning of
Don't reverse the list. Just store it from low to high order digits.
I.e., the head points to the ones digit, which points to the tens
digit, etc. That is the assumption I made with my algorithm presented
in the second post of this thread, because almost all operations use
the number beginning
Enter the lines into a FIFO queue as you read them. After you have
enqueued n lines, dequeue a line every time you enqueue one, so that
the queue will contain the last n (or fewer) lines of the file.
Dave
On Aug 13, 1:13 pm, amit amitjaspal...@gmail.com wrote:
I am trying using fseek but
25 matches
Mail list logo