摘要:
class Solution { public List preorderTraversal(TreeNode root) { Stack stack=new Stack(); List res=new ArrayList(); while(root!=null||!stack.isEmpty()) { ... 阅读全文
摘要:
class Solution { public void reorderList(ListNode head) { ListNode p=head, q=head; while(p!=null&&p.next!=null) { p=p.next.next; q=q.next; ... 阅读全文