
剑指offer
明目先生
这个作者很懒,什么都没留下…
展开
-
【剑指offer】完成链表反转成arraylist
public class Solution { public ArrayList<Integer> printListFromTailToHead(ListNode listNode) { ListNode tmp = listNode; ArrayList<Integer> arraylist = new ArrayList<>(); while(tmp!=null){ arraylist.原创 2022-03-09 21:29:48 · 194 阅读 · 0 评论 -
【剑指offer】替换空格为“%20”
public String replaceSpace (String s) { // write code here StringBuilder sb = new StringBuilder(); for(int i=0;i<s.length();i++){ if(s.charAt(i) == ' '){ sb.append("%20"); }else{原创 2022-03-09 20:36:15 · 107 阅读 · 0 评论 -
【剑指offer】判断mxn二维排序数组是否存在某值
public class Solution { public boolean Find(int target, int [][] array) { int row,col,row_length,col_length; row_length = array.length; col_length = array[0].length; row = row_length-1; col = 0; for(int原创 2022-03-09 20:10:40 · 118 阅读 · 0 评论