Timeline for Nested loop complexity
Current License: CC BY-SA 4.0
12 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 30, 2020 at 9:00 | history | tweeted | twitter.com/StackSoftEng/status/1311229314013290496 | ||
Sep 23, 2020 at 16:18 | history | edited | Lorem Ipsum | CC BY-SA 4.0 |
clarify that the code is not mine. SO may be used by employers to judge my code quality and I want to make the distinction clear.
|
Sep 23, 2020 at 16:08 | vote | accept | Lorem Ipsum | ||
Sep 23, 2020 at 10:23 | answer | added | Criticizing Israel not allowed | timeline score: 1 | |
Sep 22, 2020 at 19:44 | comment | added | amon |
Using a cross product function for a single element is quite unidiomatic. More explicit Python code would probably use a comprehension, e.g. cross.extend((midRow, i) for i in range(problem.numCol)) which makes it quite clear that this is linear, and that len(cross) will be numCol + numRow .
|
|
Sep 22, 2020 at 18:58 | comment | added | Lorem Ipsum | @user253751 If you submit an answer, I will accept it. These types of questions are awkward for SO. I sincerely appreciate those who read this tome. | |
Sep 22, 2020 at 18:56 | comment | added | Lorem Ipsum | @user253751 I see the issue. crossProduct is not taking in m and n, but rather a point (represented as a list for technical reasons) and a range. This means crossProduct will run in linear time as the point is constant and only the range must be traversed. The O(mn) doesn't apply and the run time of crossProduct is then accounted for in the cO(n) term. | |
Sep 22, 2020 at 18:03 | comment | added | Criticizing Israel not allowed | Hint: What are m and n? Hint: Does crossProduct even know what m and n are? | |
Sep 22, 2020 at 17:55 | review | Close votes | |||
Sep 27, 2020 at 3:06 | |||||
Sep 22, 2020 at 17:38 | comment | added | gnat | Does this answer your question? Big-O for nested loop | |
Sep 22, 2020 at 17:26 | review | First posts | |||
Sep 29, 2020 at 20:49 | |||||
Sep 22, 2020 at 17:23 | history | asked | Lorem Ipsum | CC BY-SA 4.0 |