How to write a program to output multiple results
|
10-26-2020, 12:49 PM
Post: #6
|
|||
|
|||
RE: How to write a program to output multiple results
(10-26-2020 10:27 AM)pinkman Wrote: ret := CONCAT(ret, c); CONCAT builds a new list, combining ret and c, using time of O(len(ret) + len(c)) We might speed it up by building nest-list, then flatten it. ret := {{}}; // list of list ... ret[0] := {ret[0], c}; // inplace update, not building long list (assumed 0-based indexing) ... return flatten(ret); Example: XCas> lst := [[]] XCas> lst[0] := [lst[0], [1,2,3]] XCas> lst[0] := [lst[0], [4,5,6]] XCas> flatten(lst) [1,2,3,4,5,6] |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
How to write a program to output multiple results - cloudxff - 10-25-2020, 03:52 AM
RE: How to write a program to output multiple results - pinkman - 10-25-2020, 06:47 PM
RE: How to write a program to output multiple results - cloudxff - 10-26-2020, 03:35 AM
RE: How to write a program to output multiple results - pinkman - 10-26-2020, 10:27 AM
RE: How to write a program to output multiple results - cloudxff - 10-26-2020, 11:32 AM
RE: How to write a program to output multiple results - Albert Chan - 10-26-2020 12:49 PM
RE: How to write a program to output multiple results - pinkman - 10-26-2020, 01:23 PM
RE: How to write a program to output multiple results - Albert Chan - 10-26-2020, 06:54 PM
RE: How to write a program to output multiple results - cloudxff - 10-27-2020, 04:55 AM
RE: How to write a program to output multiple results - StephenG1CMZ - 10-26-2020, 02:51 PM
|
User(s) browsing this thread: 3 Guest(s)