reverse and finding middle element in linked list