Timeline for Time complexity of generating Pascal's triangle
Current License: CC BY-SA 4.0
14 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Oct 4, 2021 at 21:54 | comment | added | no comment | I'd like to see that "bit of tweaking", i.e., a correct solution using that. And your code still doesn't use that rule that despite the "using these two rules" statement. | |
Oct 4, 2021 at 21:51 | comment | added | jdt | @don'ttalkjustcode, this link should give you a better understanding. The method I suggested uses binomial expansion, but 11^n is also valid with a bit of tweaking. | |
Oct 4, 2021 at 21:05 | comment | added | iSR5 |
@don'ttalkjustcode true, I was doing Math.Pow(11, rownum) but then @JohanduToit provided a better and simpler way, so I decided to use his version instead.
|
|
Oct 4, 2021 at 20:59 | comment | added | no comment | And how do you deal with this "overlapping"? Also, there's no 11^n or even just an 11 or anything resembling it anywhere in your code. Even though you're saying "using these two rules". | |
Oct 4, 2021 at 20:45 | comment | added | iSR5 |
@don'ttalkjustcode from 11^5 and up, it overlaps so 161051 it overlaps to 15 10 10 51
|
|
Oct 4, 2021 at 20:25 | comment | added | no comment |
11^5 is 161051 , that's not even symmetric.
|
|
Oct 4, 2021 at 20:22 | comment | added | iSR5 |
@don'ttalkjustcode it means 11^2 = 121, 11^3=1331,..etc
|
|
Oct 4, 2021 at 20:19 | comment | added | no comment | "Each row is an exponent of 11^n" - Huh? What does that mean? | |
Oct 4, 2021 at 18:13 | comment | added | jdt | You are welcome!! | |
Oct 4, 2021 at 18:11 | comment | added | iSR5 | @JohanduToit Thanks for the fix, your version is way better, I have borrowed it though ;). | |
Oct 4, 2021 at 18:09 | history | edited | iSR5 | CC BY-SA 4.0 |
deleted 269 characters in body
|
Oct 4, 2021 at 18:01 | comment | added | jdt | Here is a simpler approach that works correctly =) TIO | |
Oct 4, 2021 at 17:23 | comment | added | jdt |
it looks like GetPascalTriangle always returns one additional row and fails if any of the numbers gets larger than 9 TIO
|
|
Oct 4, 2021 at 4:23 | history | answered | iSR5 | CC BY-SA 4.0 |