Timeline for Reducing the time for rolling hash
Current License: CC BY-SA 4.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 5, 2019 at 5:56 | comment | added | Fiestyhokage | @L.F. Thank you! I just read this thread and now understand your point [link]stackoverflow.com/questions/24901/… | |
Aug 5, 2019 at 2:48 | comment | added | L. F. |
@danielspaniol For some strange reason I didn't noticed your comment, sorry for that. My take is that in theory they are indeed the same in this particular situation, but ++i does logically what we want to do here, and in general ++i is faster than i++ , so sticking to ++i is probably a good idea. A discarded value i++ just look as "wrong" as *(&x) + char(1) + 2 + 0["\003"] - (short)5 + 9 in place of x + 10 to many of us (well, that's a bit exaggerated), also any decent compiler should generate equivalent code for them.
|
|
Aug 5, 2019 at 2:35 | comment | added | L. F. | @Ananthhokage No, of course not. There is absolutely no reason to downvote you for that. If you challenge my opinion, I will happily discuss with you. | |
Aug 4, 2019 at 18:22 | comment | added | Fiestyhokage | @danielspaniol yes I know about that but am afraid I might get downvoted even if I remotely sound confronting their opinion lol. | |
Aug 1, 2019 at 17:08 | comment | added | danielspaniol |
As a standalone statement (like in a for loop) it does not really matter if you use ++i or i++ . Saying that pre-increment is the "correct" one is a matter of taste.
|
|
Aug 1, 2019 at 12:18 | comment | added | Fiestyhokage | First of all thanks for answering here and responding to my other question on stackoverflow XD.I tried your your code (copy_pasted it prior to examining it) it still gave me timeout(should be less than 0.6 secs).I agree i need to use libraries more and figure out which ones are effective keeping in mind the time constraints.If you wanna try out the question yourself [link]practice.geeksforgeeks.org/contest-problem/… .Thanks again! | |
Aug 1, 2019 at 10:01 | history | answered | L. F. | CC BY-SA 4.0 |