LeetCode 1387. Sort Integers by The Power Value将整数按权重排序【Medium】【Python】【排序】 Problem "LeetCode" The power of an integer is defined as the number of ste ...
分类:
编程语言 时间:
2020-03-22 10:23:56
阅读次数:
87
看到这个第一反应是当作字符去处理,于是就有了下面比较奇葩的代码哈哈哈,后面看到其他人一水的用运算解决,感觉时间和空间上会好很多,这里还是贴出来: class Solution { public int reverse(int x) { char[] chars=String.valueOf(x).t ...
分类:
其他好文 时间:
2020-03-22 01:41:43
阅读次数:
77
1.英文缩写 比如换行\n代表【+newline】;退格\b代表【+backspace】;回车\r代表【+return】。大家可以按照这种方法记住转义字符的含义 整数,整数英文为integer,简写做int整数,整数英文为integer,简写做int str代表字符串,全称为string,整数的英文 ...
分类:
编程语言 时间:
2020-03-22 01:08:35
阅读次数:
97
问题描述: 有一兔子,从出生后第3个月起每个月都生一兔子, 小兔子长到第三个月后每个月又生一对兔子 ,假如兔子都不死,问每个月的兔子总数为多少? 问题分析: 月份 兔子数 分析 1 1 f(1)=1 2 1 f(2)=1 3 1+1 f(3)=2 4 1+1 +1 f(4)=3 5 1+1+1 +1 ...
分类:
其他好文 时间:
2020-03-21 23:27:38
阅读次数:
88
堆排序 堆排序(Heapsort)是指利用堆这种数据结构所设计的一种排序算法。堆是一个近似完全二叉树的结构,并同时满足堆积的性质:即子结点的键值总是小于(或者大于)它的父节点,前者称为大顶堆,后者成为小顶堆 解析(大顶堆) 大顶堆即父结点的值总是大于孩子结点 图示(以树为魂,以数组为形) 逻辑表示( ...
分类:
编程语言 时间:
2020-03-21 20:58:40
阅读次数:
82
如何将Object类型转换为int类型 Object object = null; try { Integer.parseInt(object.toString()); } catch (NumberFormatException e) {} 也可以先判定一下是否是Integer //可以先判定一下 ...
分类:
编程语言 时间:
2020-03-21 19:45:34
阅读次数:
126
QSpinBox:步长调节器和一个单行文本框 案例 from PyQt5.Qt import * class SB(QSpinBox): def textFromValue(self, p_int): print("xx2", p_int) # 1 * 1 return str(p_int) + " ...
分类:
其他好文 时间:
2020-03-21 18:05:26
阅读次数:
71
一.实体类BigDog.java package reflex;public class BigDog extends Dog { private Integer age; public String name; public BigDog(){} private void getDog(){} p ...
分类:
编程语言 时间:
2020-03-21 16:35:18
阅读次数:
69
1.排序基本知识 1.1初始排序 1.2十大排序算法 2.冒泡排序(Bubble Sort) 2.1Baseline static void bubbleSort1(Integer[] array) { for (int end = array.length - 1; end > 0; end--) ...
分类:
编程语言 时间:
2020-03-21 16:15:14
阅读次数:
62
Given any positive integer N , you are supposed to find all of its prime factors, and write them in the format N = p 1 k 1× p 2 k 2×?× p m k m . Input ...
分类:
其他好文 时间:
2020-03-21 13:10:32
阅读次数:
77