剑指offer算法题

1二维数组从左往右从上往下都是递增的,求某个数是否在此二维数组内

public class No2Array{
    public static void main(String[] args){
      int[][] array={{1,2,8,9},
                     {2,4,9,12},
                     {4,7,10,13},
                     {6,8,11,15}};
         System.out.println(findByTheUpperRightCorner(5,array));
         System.out.println(findByTheLowerLeftCorner(7,array));
    		 }
      Public static void findByTheUpperRightCorner(int target,int [][] array)
			{
				Int rows = array.length;
				Int colunms=array[0].length;
				Int row=0;
				Int column=columns-1;
				While(row=0)
					{
						If(target==array[row][column])
						Return true;
						If(target
2、将字符串中的空格换成%20

	public static void main(String[] args){
		String str ="we are happy"
		Char [] string=str.toChatArray();
	
		Replace(string);
	}
	Public static void replace(char[] string){
	Int length= string.length;
	For(int I = 0;i
}



你可能感兴趣的:(数据结构)