Given a binary tree, determine if it is a valid binary search tree (BST).
leetcode-84-Largest Rectangle in Histogram
Given n non-negative integers representing the histogram’s bar height where the width of each bar is 1, find the area of largest rectangle in the histogram.
leetcode-85-Maximal Rectangle
Given a 2D binary matrix filled with 0’s and 1’s, find the largest rectangle containing only 1’s and return its area.
学习爬虫Part5-动态爬取解决方案 之 手动分析
学习爬虫Part4-初遇json&爬取某宝商品信息
初遇json&爬取某宝商品信息
JSON
是什么
json是轻量级的文本数据交换格式,符合json的格式的字符串叫json字符串,其格式就像python中字符串化后的字典,有时字典中还杂着列表字典,但是里面的数据都被双引号包着,下面是一个例子1
2
3
4
5
6
7'{"Africa": [
{ "name":"蜜獾" , "nickname":"平头哥" },
{ "name":"虫子" , "nickname":"小辣条" },
{ "name":"毒蛇" , "nickname":"大面筋" }
]
}'
#这是理想化的数据,实际上看到的json是不分行堆在一起,而且更多时候用unicode编码取代中文
而且为了能更好的传输各种语言,json对非英语的字符串进行了Unicode编码,于是我们直接看到的json数据通常都是带着\uxxxx的字符串而不会带着中文,json数据还会堆在一起不换行,给我们的分析带来了困难,不过我们有json 模块让它转回中文,更有一个 https://www.bejson.com/ 把它转回中文同时排版,分析json数据时多用这个工具。