Programming puzzles: processing lists!
|
06-28-2017, 04:35 AM
Post: #173
|
|||
|
|||
RE: Programming puzzles: processing lists!
(06-25-2017 11:50 AM)pier4r Wrote: Going through the algorithm for #34 . The idea is to feed one value at time (without arranging optimally the list in input beforehand, also, shuffle it a bit to be sure it is messy) and perform insertions in a balanced search binary tree (that has to keep the balancing). Pier, you are an artist as well as a calculator enthusiast! You're also way ahead of me in the challenges as I have fallen behind while, uhm, working on other things. Here's a couple submissions for #14 and #15, which I opted to do with only the built-in commands. I assumed (perhaps wrongly) that the list wouldn't begin or end with the sentinel (0). They're almost identical, but I suppose that's to be expected: Code: Ch14 You may already be aware of this, and I couldn't remember if this has already been mentioned: the first example for #15 appears to have an incorrect result. Shouldn't it be 201 (base 4) instead of 111? #16 has three parts, and I wasn't about to skip using my newfangled DOPERM command for these: Code: C1601 #17 is very straightforward with DOPERM. It appears that my 50g is OK with up to 7 digits for this particular exercise. 8 digits gives a result of (8!-1) entries (40319), which well exceeds the memory available for the stack. Here's the submission: Code: Ch17 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)