@@ -0,0 +1,1104 @@
+/**%0A * Definition for singly-linked list.%0A * public class ListNode %7B%0A *     int val;%0A *     ListNode next;%0A *     ListNode(int x) %7B val = x; %7D%0A * %7D%0A */%0A/**%0A * Definition for a binary tree node.%0A * public class TreeNode %7B%0A *     int val;%0A *     TreeNode left;%0A *     TreeNode right;%0A *     TreeNode(int x) %7B val = x; %7D%0A * %7D%0A */%0Aclass Solution %7B%0A    public TreeNode sortedListToBST(ListNode head) %7B%0A        if(head==null)%0A            return null;%0A        %0A        List%3CInteger%3E valList=new ArrayList%3CInteger%3E();%0A        while(head!=null)%7B%0A            valList.add(head.val);%0A            head=head.next;%0A        %7D%0A        return binaryHelper(0,valList.size()-1,valList);%0A    %7D%0A    private TreeNode binaryHelper(int strt, int end, List%3CInteger%3E lst)%7B%0A        if(strt%3Eend)%0A            return null;%0A        if(strt==end)%7B%0A            return new TreeNode(lst.get(strt));%0A        %7D%0A        %0A        %0A        int split=(strt+end)/2;%0A        TreeNode root=new TreeNode(lst.get(split));%0A        root.left=binaryHelper(strt,split-1,lst);%0A        root.right=binaryHelper(split+1,end,lst);%0A        return root;%0A    %7D%0A%7D%0A

Create linkedlistToBST.java