Title |
User |
Message |
Date Posted |
Re: TLE even after correct algorithm |
magicalsoup |
So this is a hint, your program runs at a time complexity of O(n^2), which is too slow, remember a binary search tree searches in log(n) time, and you want your program to run O(n log(n)) speed, which... |
Jul 13, 2018 - 2:54:06 pm UTC |
Re: TLE even after correct algorithm |
competitivecoder |
Hi :) I was not claiming that problem is wrong it must be correct.My point was just asking for help since I don't know anything better than this :) .Would you mind giving me any hint :) Thanks a lot f... |
Nov 08, 2015 - 5:19:01 am UTC |
Re: TLE even after correct algorithm |
jargon |
Sorry, you do not have the correct algorithm. Directly implementing a BST is not fast enough. (Incidentally, malloc is not faster than new, especially for POD types.) In general, if the problem has m... |
Nov 07, 2015 - 5:34:54 pm UTC |
TLE even after correct algorithm |
competitivecoder |
Hi :) I have implemented best algorithm in my knowledge but I was only able to clear few test cases :( .I tried with fast io but that too timed out.I changed new to malloc but that was also TLE.Please... |
Nov 07, 2015 - 11:13:42 am UTC |
Re: Output |
hansonw1 |
The first number is automatically put as the root, and nothing happens to the counter. All the other numbers are inserted normally, though. |
Jan 03, 2009 - 5:32:43 pm UTC |