Description
Find the middle node of a linked list.
Example
- Given 1->2->3, return the node with value 2.
- Given 1->2, return the node with value 1.
Challenge If the linked list is in a data stream, can you find …
start+1<end
mid= start + (end – start) / 2
确保不会越界Description
Find the last position of a target number in a sorted array. Return -1 if target does not exist.
Example …