Skip to content

Commit a7e6567

Browse files
authored
Finish 222 and update 15
1 parent 268385c commit a7e6567

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,8 @@ c. Python2里面继承object的是新式类,没有写父类的是经典类
440440

441441
d. 经典类目前在Python里基本没有应用
442442

443+
e.经典类的MRO是深度优先搜索,新式类的MRO是广度优先搜索
444+
443445
### 16.python中内置的数据结构有几种?
444446
a. 整型 int、 长整型 long、浮点型 float、 复数 complex
445447

@@ -2391,6 +2393,11 @@ redis检查内存使用情况,如果大于maxmemory的限制,则根据设定
23912393

23922394
## 数据结构
23932395
### 222.数组中出现次数超过一半的数字-Python版
2396+
```pythondef
2397+
def majorityElement(nums):
2398+
nums.sort()
2399+
return nums[len(nums)/2]
2400+
```
23942401
### 223.求100以内的质数
23952402
### 224.无重复字符的最长子串-Python实现
23962403
### 225.通过2个5/6升得水壶从池塘得到3升水

0 commit comments

Comments
 (0)