TinaCristal's Blog


  • Home

  • Tags

  • Categories

  • Archives

  • Search

L1-删除排序数组中的重复数字 II

Posted on 2018-05-30 | In LintCode

跟进“删除重复数字”:

如果可以允许出现两次重复将如何处理?

Read more »

L1-删除排序数组中的重复数字

Posted on 2018-05-30

给定一个排序数组,在原数组中删除重复出现的数字,使得每个元素只出现一次,并且返回新的数组的长度。

不要使用额外的数组空间,必须在原地没有额外空间的条件下完成。

您在真实的面试中是否遇到过这个题?
样例
给出数组A =[1,1,2],你的函数应该返回长度2,此时A=[1,2]。

Read more »

sublimetext 控制台乱码

Posted on 2018-05-30
1
2
3
4
5
6
7
8
9
工具 -> 编译系统  -> 新编译系统
{
"cmd": ["python","-u","$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python",
"encoding": "cp936"
}

用上面的代码替换掉"shell_cmd": "make", 保存当前配置文件为: "python_支持中文.sublime-build", 然后在工具->编译系统->选择 "python_支持中文"

bootstrap学习笔记(一)

Posted on 2018-05-30 | In web

Bootstrap:响应式框架,它会根据你的屏幕的大小来调整HTML元素的大小 —— 强调 响应式设计的概念

常用APIs

引入

1
2
3
4
5
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css"/>

<div class="container-fluid">
...
</div>
Read more »

L1-平衡二叉树

Posted on 2018-05-28 | In LintCode

平衡二叉树
给定一个二叉树,确定它是高度平衡的。对于这个问题,一棵高度平衡的二叉树的定义是:一棵二叉树中每个节点的两个子树的深度相差不会超过1。

Read more »

virtualenv Django在aphae2的配置

Posted on 2018-05-27 | In 环境安装配置

网上教程很多 有的是旧版本 有很多误区
导致配了半天 特意记录一下流程

virtualenv下的python3.5 Django在aphache2部署

python3.5 位置 /home/tina/.local/virtualenvs/jobboardscraper

Read more »

L1-o(1)检测2的幂次

Posted on 2018-05-27 | In LintCode

用 O(1) 时间检测整数 n 是否是 2 的幂次。

样例
n=4,返回 true;

n=5,返回 false.

挑战
O(1) time

Read more »

L1-合并区间

Posted on 2018-05-27 | In LintCode

给出若干闭合区间,合并所有重叠的部分。

样例

给出的区间列表 => 合并后的区间列表:

[ [
[1, 3], [1, 6],
[2, 6], => [8, 10],
[8, 10], [15, 18]
[15, 18] ]
]

挑战
O(n log n) 的时间和 O(1) 的额外空间。

思路

贪心法,需要依赖链表每个节点的start进行排序,避免出现[2,3][3,6][5,9][1,10]这样的情况出现,排序的复杂度为nlogn,比较的复杂度为n

Read more »

周总结(4)

Posted on 2018-05-26 | In 周总结

生活

  • 这周早起的日子变成习惯了,很可能是快期末的原因吧,再加上so many so many busy things,坚持不易,尤其是我还有一点拖延症,给自己鼓掌
    Read more »

jQuery选择器

Posted on 2018-05-26

type选择器$(“button”)、class选择器$(“.btn”)、id选择器$(“#target1”)。

Read more »

1…363738…45

TinaCristal

443 posts
57 categories
55 tags
GitHub E-Mail
© 2020 TinaCristal
Powered by Hexo
|
Theme — NexT.Mist v5.1.4