摘要:
如何刷题?就是200道题! 原则: 生长学习法+科学练习 生长学习法: 你是怎么想到的?思路!==》思路报告! 思路报告: 01.题目 02.例子 03.题目假设 04.重要问题 05.直觉 06.解决方法的可能性 07.解决方案 08.数据结构 09.算法复杂度:时间空间 总结: 要有脑子! 阅读全文
摘要:
class MyQueue(object): def __init__(self, ): """ Initialize your data structure here. """ self.instack = [] self.outstack = [] def push(self, x): ... 阅读全文
摘要:
s = 'we are happy's = s.replace(' ','%20')print s s = 'we are happy' s = s.replace(' ','%20') print s 阅读全文
摘要:
# -*- coding:utf-8 -*- from collections import Counter class Solution(object): def findRepeatNum(self,input_list): if not input_list: return c = Counter(input_list) ... 阅读全文
摘要:
# -*- coding:utf-8 -*- class Solution(object): def fNumInSorted(self,input_list,target_num): if not input_list: return if not target_num: return r... 阅读全文
摘要:
面向对象学习 目录: 1.面向对象介绍 2.为什么要用面向对象 3.面向对象的特性:封装、集成、多态 4.如何写出面向对象的程序:领域建模 5.面向对象高阶语法: A.经典类、新式类 B.静态方法、类方法、属性方法 C.类的特殊方法 D.反射 6.作业 7.感悟ending 内容: 1.面向对象介绍 编程:计算机语言py+算法+数据结构,根据任务设... 阅读全文
摘要:
chapter 13.shell数组的应用实践 1.介绍 shell数组是元素的集合,数据的一种格式; 2.定义 array=(value1 value2 value3...) 对于元素较长的:竖着写 静态的! array=($(命令)) array(`命令`) 动态的 3.打印 打印数组个数:echo ${#array[*]} echo ${#array[@]} 打印数组元素:所有元... 阅读全文
摘要:
07if条件语句的语法和实战 语法: 实战: 01.监控web和数据库的企业案例 如何获取数据: 端口监控:netstat、ss、lsof 本地:netstat -lnt | grep 3306 | awk -F ":" '{print $2}' | awk '{print $1}' | wc -l ss -lntup | grep mysql | wc -l ... 阅读全文
摘要:
chapter 06.shell脚本的条件测试和比较 6.1shell脚本的条件测试 6.1.1条件测试方法综述 test [] [[]] (()) 6.1.2test条件测试的语法和示例 [root@bogon ~]# test -f n.sh && echo "0" || echo "1" ###0 [root@bogon ~]# test -z "hello" && e... 阅读全文
摘要:
Chapter 1 如何才能学好shell编程 1.0多写、多写;每个代码都要写 Chapter 2 Shell脚本 2.1 什么是shell? 2.2 什么是shell脚本? 2.3 shell脚本的地位 2.4 shell脚本的种类 B shell(bash、sh)、C shell 2.5 常用的操作系统默认的shell [root@bogon ~]# cat /etc/s... 阅读全文