- 博客(6)
- 收藏
- 关注
原创 (算法1) 从数组中快速寻找两数字之和为目标的数字 python
Bruteforce算法双循环一个个检测所有两个数字组合时间复杂度: O(n^2)class Solution(object): def twoSum(self, nums, target): """ :type nums: List[int] :type target: int :rtype: List[in...
2020-04-02 10:59:02 736
原创 shell basics
前言:shell没有任何data typecomment #文件开头加 #!/bin/shrunning shell:chmod 755 program.sh then ./program.shvariable赋值不需要$ 使用要加$a=hellob="world"c=123echo "$a $b $c" #输入 hello world 123stdin...
2018-11-12 07:32:39 192
原创 linux filter
egrep—matching lines格式: egrep [option] inputFileegrep: 匹配符合的行egrep -i : case-insensitveegrep -v: 匹配不符合的行egrep -c: 打印符合的行数examples:egrep -v “^$” : 去掉空白行返回值:如果有匹配的字符串,返回值是0(真), 还会打印出匹配字符串的行。如...
2018-11-11 13:01:11 708
原创 C语言中的整数表示和进制转换
整数的表示整数在C语言中有三种表示方法,分别为signed decimal (24), unsigned hexadecimal ( 0x3C), signed octal (052);当然int型也可以分成signed和unsigned,无符号整数的取值范围为0..2^32-1, 有符号的取值范围为-2^31 .. 2^31-1.但是有一个问题是如果所有数据在计算机中以二进制来表示,那在二进制中...
2018-06-26 16:32:50 4185
原创 字符数据在计算机中的表示ASCII 和UTF-8
字符数据-character data字符在计算机中主要有两种表示方法:1.ASCII, 2.Unicode(UTF-8),以下为两种编码的定义ASCII 码使用指定的7 位或8 位二进制数组合来表示128 或256 种可能的字符。标准ASCII 码也叫基础ASCII码,使用7 位二进制数(剩下的1位二进制为0)来表示所有的大写和小写字母,数字0 到9、标点符号, 以及在美式英语中使用的特殊控制...
2018-06-25 16:14:52 3083
原创 计算机的bit,byte及相关操作和file permission
BIT计算机数据储存以二进制为基础,通常情况下,计算机中:char = 1 byte = 8 bits ('a' is 01100001)short = 2 bytes = 16 bits (42 is 0000000000101010)int = 4 bytes = 32 bits (42 is 0000000000...0000101010)double = 8 bytes ...
2018-06-23 17:50:26 288
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人