上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 27 下一页
public static boolean isLooped(int num) { StringBuilder strBuilder = new StringBuilder(String.valueOf(num)); int l = 0; //左指针 int r = strBuilder.lengt Read More
posted @ 2021-07-09 13:38 人在京城 Views(74) Comments(0) Diggs(0)
public static void main(String[] args) { Tree treeG = new Tree('G', null, null); Tree treeD = new Tree('D', null, null); Tree treeF = new Tree('F', nu Read More
posted @ 2021-07-01 11:25 人在京城 Views(210) Comments(0) Diggs(0)
public static void main(String[] args) { System.out.println(JSON.toJSON(kingRing(41, 3))); } //链表实现-删除效率高-不需要复制或移动元素 public static Integer[] kingRing( Read More
posted @ 2021-06-29 11:41 人在京城 Views(52) Comments(0) Diggs(0)
public static void main(String[] args) { int[] value = {100, 150, 350}; int[] weight = {1, 4, 3}; System.out.println(dynamic(5, value, weight)); } /** Read More
posted @ 2021-06-28 16:48 人在京城 Views(57) Comments(0) Diggs(0)
import lombok.extern.slf4j.Slf4j; import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** * @author: small-sunshine * @Descrip Read More
posted @ 2021-06-25 14:57 人在京城 Views(343) Comments(0) Diggs(0)
/** * 是否可以构成一个三角形 * 1、一边存在小于或等于0的数据不能构成三角形 * 2、有任意一个满足:两边之和小于或等于第三边的情况都不能构成三角形 * * @param a * @param b * @param c * @return boolean */ public static b Read More
posted @ 2021-06-25 10:30 人在京城 Views(138) Comments(0) Diggs(0)
import java.io.*; import java.text.DecimalFormat; /** * @author: small sunshine * @Description: * @date: 2021/6/20 10:04 上午 */ public class ScoreDescS Read More
posted @ 2021-06-24 12:42 人在京城 Views(109) Comments(0) Diggs(0)
/** * 冒泡排序-稳定的,两个相同的数-相对位置不变 * * @param num * @return */ public static int[] bubbleSort(int[] num) { if (Objects.isNull(num) || num.length <= 1) { ret Read More
posted @ 2021-06-23 14:00 人在京城 Views(49) Comments(0) Diggs(0)
import com.alibaba.fastjson.JSON; import lombok.extern.slf4j.Slf4j; /** * @author: Small sun shine * @Description: * @date: 2021/6/20 9:40 上午 */ @Slf4 Read More
posted @ 2021-06-20 10:17 人在京城 Views(46) Comments(0) Diggs(0)
//递归,累计+1,非尾递归 public static int cap(int n) { if (n == 1) { return 1; } return cap((n - 1)) + 1; } //递归,累计+1,尾递归 public static int capTail(int n, int Read More
posted @ 2021-06-19 18:35 人在京城 Views(111) Comments(0) Diggs(0)
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 27 下一页