title: Splitting Linklist in two parts
body: <p>Given a list, split it into two sublists — one for the front half, and one for the back half. If the number of elements is odd, the extra element should go in the front list. So <code>FrontBackSplit()</code> on the list <code>{2, 3, 5, 7, 11}</code> should yield the two lists <code>{2, 3, 5}</code> and <code>{7, 11}</code>.</p>
  
  <p>code is this.</p>
  
  <pre><code>void FrontBackSplit(Node *head, Node **front, Node **back) {
    if (!head) return;  // Handle empty list
    Node *front_last_node;
    Node *slow = head;
    Node *fast = head;
    while (fast) {
      front_last_node = slow;
      slow = slow-&gt;next;
      fast = (fast-&gt;next) ? fast-&gt;next-&gt;next : NULL;
    }
    front_last_node-&gt;next = NULL;  // ends the front sublist
    *front = head;
    *back = slow;
  }
  </code></pre>
  
  <p>Problem is I am not getting best run-time and sometimes expected output.</p>