代码随想录训练营Day1 | 二分查找、移除元素
源文章:9. 总结篇
数组理论基础1. 数组理论基础
数组:存放在连续空间上的相同类型数据的集合
数组下标是从0开始的
数据内存空间的地址是连续的
数组元素不能删,只能覆盖
C++中二维数组在地址空间上是连续的。
Java可能是如下排列方式:
二分查找2. 二分查找
【条件】
数组为有序数组
数组中无重复元素
【写法】
左闭右闭区间[ left , right ]
1.while(left <= right) 要使用 <= ,因为left == right是有意义的,所以使用 <=
2.if (nums[middle] > target) right 要赋值为 middle - 1,因为当前这个nums[middle]一定不是target,那么接下来要查找的左区间结束下标位置就是 middle - 1
12345678910111213141516171819class Solution { public int search(int[] nums, int target) ...
【TED演讲】当你一直沉迷于"垃圾快乐"时,自律和自虐也救不了你
TED演讲:当你一直沉迷于”垃圾快乐”时,自律和自虐也救不了你_哔哩哔哩_bilibilideter 阻止
she didn’t come out as a junkie
他不会就成为了瘾君子
partly 很多一部分
None of them ever use it compulsively
他们中没有出现不得不用的
None of them ever overdose
他们都没有过量
Maybe we should call it bonding
也许我们应该称之为依赖
Human beings have a natural and innate need to bond
人类对于依赖有一种先天与自然的需要
and when we’re happy and healthy , we’ll bond and connect with each other
当我们开心并健康的时候,我们会与其他人建立一种依赖关系
get one’s head around 相通
And a core part of addiction ,I came to think , and i believe ...
【TED英语演讲】Emily Levine_2018:我如何与 现实交朋友【高清版】 中英文对照)
对生命的思考elicite 引出
not evertbody can take so cavalier an attitude
不是每个人都能抱着这么无忧无虑的心态
leadership
领导风格
Not that i can take all the credit ,but …
我并不想把功劳都归到我身上
From the get-go get-go n.开始,开端
swipe 划走
the whole thing would have been over
然后所有的事情就结束了
To be honest ,I don’t have goal;I have fantasies.They’re exactly like goals but without the hard work
实话说,我没有目标。我有幻想。他们和目标很像,只是不需要任何努力。
my executive brain function won’t have me to kick aroud anymore .
我的大脑执行功能不再让我有更多考虑
kick aroud 粗暴而轻率地对待,从各个角度考虑;流浪
in ...
Liz Truss is Britain's shortest-serving prime minister
Liz Truss is Britain’s shortest-serving prime ministerA chaotic six weeks ends in humiliating defeat.cet6考试文章阅读练习。short-serving prime minister 任职时间最短的首相the longest-reigning monarch 在位时间最长的君主end in defeat 以失败告终humiliating <- humiliate adj. [耻辱的,丢脸的]
12345Liz Truss is eligible for a taxpayer-funded allowance of $129,000 a year for life.利兹 · 特拉斯有资格享受由英国纳税人出资的每年12.9万美元的终身津贴The departing British leader would be the sixth prime minister to receive the reimbursement for her expenses after leaving ...
Blog01|第一篇文章
写在开头12345To visitor: Hello! This is my first blog.It is my honor to share my life here. Looking forward to seeing this blog in next writing! >v<! kiwilaen
Hello World
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
Quick StartCreate a new post1$ hexo new "My New Post"
More info: Writing
Run server1$ hexo server
More info: Server
Generate static files1$ hexo generate
More info: Generating
Deploy to remote sites1$ hexo deploy
More info: Deployment