自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(509)
  • 收藏
  • 关注

转载 LeetCode_104. Maximum Depth of Binary Tree

104.Maximum Depth of Binary TreeEasyGiven a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to th...

2019-09-29 15:30:00 295

转载 LeetCode_101. Symmetric Tree

101.Symmetric TreeEasyGiven a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree[1,2,2,3,4,4,3]is symmetri...

2019-09-29 10:03:00 337

转载 LeetCode_100. Same Tree

100.Same TreeEasyGiven two binary trees, write a function to check if they are the same or not.Two binary trees are considered the same if they are structurally identical an...

2019-09-28 00:46:00 329

转载 LeetCode_88. Merge Sorted Array

88.Merge Sorted ArrayEasyGiven two sorted integer arraysnums1andnums2, mergenums2intonums1as one sorted array.Note:The number of elements initialized innums1and...

2019-09-27 10:21:00 231

转载 LeetCode_83. Remove Duplicates from Sorted List

83.Remove Duplicates from Sorted ListEasyGiven a sorted linked list, delete all duplicates such that each element appear onlyonce.Example 1:Input: 1->1->2Output: ...

2019-09-26 15:38:00 124

转载 LeetCode_70. Climbing Stairs

70.Climbing StairsEasyYou are climbing a stair case. It takesnsteps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you clim...

2019-09-26 11:31:00 150

转载 LeetCode_69. Sqrt(x)

69.Sqrt(x)EasyImplementint sqrt(int x).Compute and return the square root ofx, wherexis guaranteed to be a non-negative integer.Since the return typeis an integer, th...

2019-09-25 15:24:00 141

转载 LeetCode_67. Add Binary

67.Add BinaryEasyGiven two binary strings, return their sum (also a binary string).The input strings are bothnon-emptyand contains only characters1or0.Example 1:Inp...

2019-09-25 10:47:00 139

转载 LeetCode_66. Plus One

66.Plus OneEasyGiven anon-emptyarray of digitsrepresenting a non-negative integer, plus one to the integer.The digits are stored such that the most significant digit is a...

2019-09-24 16:58:00 135

转载 LeetCode_58. Length of Last Word

58.Length of Last WordEasyGiven a stringsconsists of upper/lower-case alphabets and empty space characters' ', return the length of last word in the string.If the last wo...

2019-09-24 10:36:00 138

转载 LeetCode_53. Maximum Subarray

53.Maximum SubarrayEasyGiven an integer arraynums, find the contiguous subarray(containing at least one number) which has the largest sum and return its sum.Example:Inpu...

2019-09-23 16:23:00 134

转载 LeetCode_38. Count and Say

38.Count and SayEasyThe count-and-say sequence is the sequence of integers with the first five terms as following:1. 12. 113. 214. 12115. 111221...

2019-09-23 10:39:00 123

转载 LeetCode_35. Search Insert Position

35.Search Insert PositionEasyGiven a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted i...

2019-09-22 11:34:00 153

转载 LeetCode_28. Implement strStr()

28.Implement strStr()EasyImplementstrStr().Return the index of the first occurrence of needle in haystack, or-1if needle is not part of haystack.Example 1:Input: hays...

2019-09-20 16:12:00 148

转载 LeetCode_27. Remove Element

27.Remove ElementEasyGiven an arraynumsand a valueval, remove all instances of that valuein-placeand return the new length.Do not allocate extra space for another array...

2019-09-19 16:34:00 131

转载 LeetCode_26. Remove Duplicates from Sorted Array

26.Remove Duplicates from Sorted ArrayEasyGiven a sorted arraynums, remove the duplicatesin-placesuch that each element appear onlyonceand return the new length.Do not ...

2019-09-19 10:00:00 135

转载 LeetCode_21. Merge Two Sorted Lists

21.Merge Two Sorted ListsEasyMerge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.Exa...

2019-09-18 15:36:00 122

转载 LeetCode_20. Valid Parentheses

20.Valid ParenthesesEasyGiven a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.An input string is valid if:...

2019-09-17 16:34:00 132

转载 LeetCode_14. Longest Common Prefix

14.Longest Common PrefixEasyWrite a function to find the longest common prefix string amongst an array of strings.If there is no common prefix, return an empty string"".E...

2019-09-16 17:08:00 155

转载 LeetCode_13. Roman to Integer

13.Roman to IntegerEasyRoman numerals are represented by seven different symbols:I,V,X,L,C,DandM.Symbol ValueI 1V 5X ...

2019-09-15 13:14:00 137

转载 LeetCode_9. Palindrome Number

9.Palindrome NumberEasyDetermine whether an integer is a palindrome. An integerisapalindrome when itreads the same backward as forward.Example 1:Input: 121Output: tr...

2019-09-14 23:49:00 153

转载 LeetCode_7. Reverse Integer

7.Reverse IntegerEasyGiven a 32-bit signed integer, reverse digits of an integer.Example 1:Input: 123Output: 321Example 2:Input: -123Output: -321Example 3:...

2019-09-14 01:55:00 126

转载 LeetCode_1. Two Sum

1.Two SumEasyGiven an array of integers, returnindicesof the two numbers such that they add up to a specific target.You may assume that each input would haveexactlyone s...

2019-09-13 20:32:00 134

转载 JAVA 基础编程练习题50 【程序 50 文件 IO】

50 【程序 50 文件 IO】题目:有五个学生,每个学生有 3 门课的成绩,从键盘输入以上数据(包括学生号,姓名,三门课成绩), 计算出平均成绩,将原有的数据和计算出的平均分数存放在磁盘文件"stud"中。package cskaoyan;import java.io.BufferedWriter;import java.io.File;impo...

2019-09-12 01:17:00 222

转载 JAVA 基础编程练习题49 【程序 49 子串出现的个数】

49 【程序 49 子串出现的个数】题目:计算字符串中子串出现的次数package cskaoyan;public class cskaoyan49 { public static void main(String[] args) { // TODO Auto-generated method stub java.util.Scanne...

2019-09-11 15:04:00 229

转载 JAVA 基础编程练习题48 【程序 48 加密】

48 【程序 48 加密】题目:某个公司采用公用电话传递数据,数据是四位的整数,在传递过程中是加密的,加密 规则如下:每位数字都加上 5,然后用和除以 10 的余数代替该数字,再将第一位和第四位交 换,第二位和第三位交换。package cskaoyan;public class cskaoyan48 { public static void ma...

2019-09-11 11:14:00 251

转载 JAVA 基础编程练习题47 【程序 47 打印星号】

47 【程序 47 打印星号】题目:读取 7 个数(1—50)的整数值,每读取一个值,程序打印出该值个数的*。package cskaoyan;public class cskaoyan47 { public static void main(String[] args) { // TODO Auto-generated method stu...

2019-09-10 14:43:00 486

转载 JAVA 基础编程练习题46 【程序 46 字符串连接】

46 【程序 46 字符串连接】题目:两个字符串连接程序package cskaoyan;public class cskaoyan46 { public static void main(String[] args) { // TODO Auto-generated method stub java.util.Scanner in =...

2019-09-10 10:39:00 292

转载 JAVA 基础编程练习题45 【程序 45 被 9 整除】

45 【程序 45 被 9 整除】题目:判断一个素数能被几个 9 整除package cskaoyan;public class cskaoyan45 { public static void main(String[] args) { // TODO Auto-generated method stub java.util.Scann...

2019-09-09 15:33:00 282

转载 JAVA 基础编程练习题44 【程序 44 偶数的素数和】

44 【程序 44 偶数的素数和】题目:一个偶数总能表示为两个素数之和。package cskaoyan;public class cskaoyan44 { @org.junit.Test public void sum() { java.util.Scanner in = new java.util.Scanner(System.in);...

2019-09-09 10:20:00 228

转载 JAVA 基础编程练习题43 【程序 43 求奇数个数】

43 【程序 43 求奇数个数】题目:求 0—7 所能组成的奇数个数。package cskaoyan;public class cskaoyan43 { @org.junit.Test public void odd() { long sum = 4; long s = 4; long i = 0; for (i = ...

2019-09-08 11:48:00 335

转载 JAVA 基础编程练习题42 【程序 42 求数字】

42 【程序 42 求数字】题目:809*??=800*??+9*??+1其中??代表的两位数,8*??的结果为两位数,9*??的结果为 3 位数。求??代表的两位数,及 809*??后的结 果。package cskaoyan;public class cskaoyan42 { @org.junit.Test public void numb...

2019-09-07 02:47:00 226

转载 JAVA 基础编程练习题41 【程序 41 猴子分桃】

41 【程序 41 猴子分桃】题目:海滩上有一堆桃子,五只猴子来分。第一只猴子把这堆桃子凭据分为五份,多了一个,这只猴子把 多的一个扔入海中,拿走了一份。第二只猴子把剩下的桃子又平均分成五份,又多了一个,它同样把多的 一个扔入海中,拿走了一份,第三、第四、第五只猴子都是这样做的,问海滩上原来最少有多少个桃子?package cskaoyan;public ...

2019-09-06 15:20:00 228

转载 JAVA 基础编程练习题40 【程序 40 字符串排序】

40 【程序 40 字符串排序】题目:字符串排序。package cskaoyan;public class cskaoyan40 { @org.junit.Test public void arraySort() { java.util.Scanner in = new java.util.Scanner(System.in); Sy...

2019-09-06 11:18:00 358

转载 JAVA 基础编程练习题39 【程序 39 分数累加】

39 【程序 39 分数累加】题目:编写一个函数,输入 n 为偶数时,调用函数求 1/2+1/4+...+1/n,当输入 n 为奇数时,调用函数 1/1+1/3+...+1/npackage cskaoyan;public class cskaoyan39 { @org.junit.Test public void sum() { java....

2019-09-05 00:56:00 305

转载 JAVA 基础编程练习题38 【程序 38 求字符串长度】

38 【程序 38 求字符串长度】题目:写一个函数,求一个字符串的长度,在 main 函数中输入字符串,并输出其长度。package cskaoyan;public class cskaoyan38 { public static void main(String[] args) { // TODO Auto-generated method...

2019-09-04 01:57:00 218

转载 JAVA 基础编程练习题37 【程序 37 报数】

37 【程序 37 报数】题目:有 n 个人围成一圈,顺序排号。从第一个人开始报数(从 1 到 3 报数),凡报到 3 的人退出圈子, 问最后留下的是原来第几号的那位。package cskaoyan;public class cskaoyan37 { @org.junit.Test public void countOff() { java...

2019-09-03 00:56:00 454

转载 JAVA 基础编程练习题36 【程序 36 移动位置】

36 【程序 36 移动位置】题目:有 n 个整数,使其前面各数顺序向后移 m 个位置,最后 m 个数变成最前面的 m 个数package cskaoyan;public class cskaoyan36 { @org.junit.Test public void shift() { java.util.Scanner in = new ja...

2019-09-02 01:15:00 228

转载 JAVA 基础编程练习题35 【程序 35 最大最小交换】

35 【程序 35 最大最小交换】题目:输入数组,最大的与第一个元素交换,最小的与最后一个元素交换,输出数组。package cskaoyan;public class cskaoyan35 { @org.junit.Test public void swap() { int[] arr = new int[6]; inp(arr);...

2019-09-01 03:04:00 127

转载 JAVA 基础编程练习题34 【程序 34 三个数排序】

34 【程序 34 三个数排序】题目:输入 3 个数 a,b,c,按大小顺序输出。程序分析:利用指针方法。package cskaoyan;public class cskaoyan34 { @org.junit.Test public void swap() { java.util.Scanner in = new java.util....

2019-08-31 02:44:00 307

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除