User talk:Spoon!: Difference between revisions

(→‎Python/Java infinite generator/iterator error: applies only to fixed types of Java...)
 
(5 intermediate revisions by 4 users not shown)
Line 60:
 
A better fix would be to postpone the addition of the prime multiple culling sequences to the queue until needed as was done for the dictionary solution (the faster algorithm), in which case the algorithm will work up to the full numeric range of whatever number type is used, including 32-bit integers (2^31 - 1 or 2,147,483,647) otherwise limited to a rage of 46,349. This has the further advantage of much less memory use (by about the ratio of the square root of the memory used) and faster queue re-insertions (a large fraction of the total operations) as these access times are proportional of the log of the queue size, which would then be smaller by the given square root ratio.--[[User:GordonBGood|GordonBGood]] ([[User talk:GordonBGood|talk]]) 10:51, 24 June 2014 (UTC)
 
:Oh yeah, I hadn't thought about the types of the integer. In Python, integers automatically overflow into arbitrary-precision integers (2.x) or are already arbitrary-precision integers (3.x), so the correct translation would have been to use BigInteger. I'll think about the other solution, but a disadvantage of hash tables is that insertion and lookup are O(n) in the worst-case. Perhaps a binary search tree based dictionary will be good as insertion and lookup is amortized O(log n) in the worst case, the same as insertion and removal in a heap-based priority queue. --[[User:Spoon!|Spoon!]] ([[User talk:Spoon!|talk]]) 06:02, 25 June 2014 (UTC)
 
== Snake/Java ==
Team work, heheh. Those clunky enums look much better now. Thanks. [[User:Fwend|Fwend]] ([[User talk:Fwend|talk]]) 00:51, 14 April 2016 (UTC)
 
== Editing of Haskell's Lucky and even lucky numbers ==
 
Hi Spoon, thanks for your help. The Haskell code is now much cleaner and idiomatic.
Nevertheless you failed to test your changes and broke the code in a couple of places. I just fixed it.
 
== Dijkstra's algorithm permission ==
 
I'd like to ask your permission to use your implementation of Dijkstra's algorithm in Haskell as part of a benchmark suite for the pqueue package. [[User:Dfeuer|Dfeuer]] ([[User talk:Dfeuer|talk]]) 22:52, 10 December 2021 (UTC)
: Sure. --[[User:Spoon!|Spoon!]] ([[User talk:Spoon!|talk]]) 06:30, 11 December 2021 (UTC)
Anonymous user