public static <T extends Integer> 
  double find_median_sorted_circular_linked_list(node_t<T> r_node) {
    if (r_node == null) {
      // no node in this linked list.
      throw new IllegalArgumentException("empty list");  
    }

    // Checks all nodes are identical or not and identify the start of list.
    node_t<T> curr = r_node;
    node_t<T> start = r_node;
    int count = 0;
    do {
      ++count;
      curr = curr.next;
      // start will point to the largest element in the list.
      if (start.data.compareTo(curr.data) <= 0) {
        start = curr;
      }
    } while (curr != r_node);
    // start's next is the begin of the list.
    start = start.next;

    // Traverses to the middle of the list and return the median.
    for (int i = 0; i < ((count - 1) >> 1); ++i) {
      start = start.next;
    }
    return (count & 1) != 0 ? start.data : 0.5 * (start.data + start.next.data);
  }