摘要:
题目描述: class Solution { public ListNode getKthFromEnd(ListNode head, int k) { ListNode former = head, latter = head; for(int i = 0; i < k; i++) { if(fo 阅读全文
摘要:
题目描述: 方法:递归法 class Solution{ ArrayList<Integer> tmp = new ArrayList<>(); public int[] reversePrint(ListNode head){ recur(head); int res[] = new int[tm 阅读全文
摘要:
题目描述:写一个函数,求两个整数之和,要求在函数体内不得使用 “+”、“-”、“*”、“/” 四则运算符号。 class Solution{ public int add(int a,int b){ while(b!=0){// 当进位为 0 时跳出 int c = (a&b)<<1;// c = 阅读全文