数据结构
文章平均质量分 80
nene427
今天也很废
展开
-
1.Merge Two Sorted Arrays. py/合并排序有序数列
首先一些note: and在python里是and,不是&&也不是&! 加成员不是add(),应该用append()。一些list方法:https://docs.python.org/3/tutorial/datastructures.html 我分不清python的array和list,感觉是一个东西,stackoverflow说python的基础数据结...原创 2018-04-09 01:45:53 · 553 阅读 · 0 评论 -
2.Repeated Elements in Array/找出数组中重复部分
Note: 1.sorted()和sort()的区别: What is the difference between `sorted(list)` vs `list.sort()` ? pythonsorted() returns a new sorted list, leaving the original list unaffected. list.sort() sorts the lis...原创 2018-04-09 02:39:09 · 284 阅读 · 0 评论 -
3. First Position.Binary Search/二分查找第一次出现位置
Notes : 首先是一篇博客/*我觉得这篇文章里的二分查找法不能找到target第一次出现的位置,因为return的是mid,mid很有可能不是第一个==target的数二分查找法的实现和应用汇总1. 主要是解决在“一堆数中找出指定的数”这类问题。2. 而想要应用二分查找法,这“一堆数”必须储存在数组中并且有序排列。如果是用链表存储的话,就无法在其上应用二分查找法。因为链表的每一个节点的地址不能...原创 2018-04-10 05:32:45 · 873 阅读 · 0 评论