Write a function to find the middle of a single linked list. Please try to find the best solution.
traversing a single linked list needs O(n) time. so finding the middle point also needs O(n) time. so it seems no benefit we can get from the best algorithm. |
欢迎光临 珍珠湾ART (http://zzwav.com/) | Powered by Discuz! X3 |