- 博客(24)
- 资源 (1)
- 问答 (1)
- 收藏
- 关注
原创 python3正则表达式
python3正则表达式提供了内置的re模块import rere模块的内置方法:1. findallfindall方法会找出所有的匹配后返回一个列表例如:import restring = 'adfjalPythonsfja39fasf23rs'res = re.findall('Python', string)print(res)res = re.findall('\d...
2018-12-31 11:12:29 680
原创 Symmetric Tree
题目链接Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree [1,2,2,3,4,4,3] is symmetric:1/ \2 2/\ \ /\ 3 4 4 3But the...
2018-12-28 15:39:47 250 3
原创 Validate Binary Search Tree
题目链接Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only nodes with keys less than the node’s key.T...
2018-12-27 16:55:33 181
原创 Linked List Cycle
题目链接python代码实现:# Definition for singly-linked list.# class ListNode(object):# def __init__(self, x):# self.val = x# self.next = Noneclass Solution(object): def hasCyc...
2018-12-24 15:25:39 155
原创 Merge Two Sorted Lists
题目链接Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.Example:Input: 1->2->4, 1->3->4Output:...
2018-12-21 21:04:50 123
原创 JSON的key值为数字时如何使用
JSON(JavaScript Object Notation) 是一种轻量级的数据交换格式。易于人阅读和编写。同时也易于机器解析和生成。它基于JavaScript(Standard ECMA-262 3rd Edition - December 1999)的一个子集。 JSON采用完全独立于语言的文本格式,但是也使用了类似于C语言家族的习惯(包括C, C++, C#, Java, JavaScr...
2018-12-21 09:11:23 24220
原创 Reverse Linked List
题目链接Reverse a singly linked list.Example:Input: 1->2->3->4->5->NULLOutput: 5->4->3->2->1->NULLFollow up:A linked list can be reversed either iteratively or recurs...
2018-12-20 22:01:14 109
原创 Remove Nth Node From End of List
Given a linked list, remove the n-th node from the end of list and return its head.Example:Given linked list: 1->2->3->4->5, and n = 2.After removing the second node from the end, the ...
2018-12-20 21:52:10 168
原创 Delete Node in a Linked List
题目链接Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.Given linked list – head = [4,5,1,9], which looks like following:4 -> 5 -> 1 -&...
2018-12-19 16:57:33 137
原创 Longest Common Prefix
题目链接Write a function to find the longest common prefix string amongst an array of strings.If there is no common prefix, return an empty string “”.Example 1:Input: [“flower”,“flow”,“flight”]Outpu...
2018-12-17 22:17:31 114
原创 tensorflow查看电脑的CPU和GPU
1、查看电脑GPU和CPUimport osfrom tensorflow.python.client import device_libos.environ["TF_CPP_MIN_LOG_LEVEL"] = "99" if __name__ == "__main__": print(device_lib.list_local_devices())2.指定C
2018-12-13 19:34:40 1087 2
原创 ubuntu下安装tensorflow-gpu
首先说明:实验室的服务器已经配置好了NVIDIA的环境,所以我只在自己的账户下做了如下配置:1. 首先下载anacon3wget + 下载链接URL + 想要的版本号例如:wget + https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/ + Anaconda3-5.2.0-Linux-x86_64.shwget https://mi...
2018-12-13 19:14:24 349
转载 CPU、GPU使用情况查看以及各个参数含义
1. Linux下查看CPU和GPU使用情况本文记录了如何在Linux系统(以Ubuntu 16.04为例)查看电脑的GPU和CPU使用情况,包括命令和查询得到的界面。更新于2018.10.18。CPU使用情况查看动态查看打开终端,输入:top即可看到实时的CPU使用情况,如下图所示:按Ctrl+C退出查看。查看版本top -h即可看到当前procps-ng的版本。GP...
2018-12-13 16:48:17 14985 4
原创 前端面试题
1. 下面哪些语句可以 在JS里判断一个对象oStringObject是否为String。oStringObject instanceof Stringtypeof oStringObject == ‘string’oStringObject is String以上答案都不正确解释:JS 中值的类型分为原始值类型和对象类型。原始值类型包括 number, string, boole...
2018-12-12 11:14:05 460 1
原创 Valid Palindrome
题目链接Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.Note:For the purpose of this problem, we define empty string as valid palindrome.E...
2018-12-11 16:30:49 117
原创 Valid Anagram
题目链接Given two strings s and t , write a function to determine if t is an anagram of s.Example 1:Input: s = “anagram”, t = “nagaram”Output: trueExample 2:Input: s = “rat”, t = “car”Output: fa...
2018-12-10 13:13:28 121
原创 浏览器兼容性处理
在对HTML5的使用中,会出现很多浏览器兼容性的问题。如何解决?在Chrome浏览器上加上前缀webkit在firefox浏览器上加上前缀moz在IE浏览器上加上前缀ms在opera浏览器上加上前缀o...
2018-12-07 15:58:50 177
原创 First Unique Character in a String
题目链接Given a string, find the first non-repeating character in it and return it’s index. If it doesn’t exist, return -1.Examples:s = “leetcode”return 0.s = “loveleetcode”,return 2.Note:You ma...
2018-12-06 11:21:38 158
原创 CSS3 box-sizing属性
box-sizing属性可以为三个值之一:content-box(default),border-box,padding-box。content-box: border和padding不计算入width之内。padding-box: padding计算入width内。border-box: border和padding计算入width之内。例子:<style ty......
2018-12-05 10:55:18 376
原创 html5+css3学习笔记(一)
语义化标签html5给我们增加了许多语义化的标签,比如header、footer、nav、main、article、aside等,这些标签和div有同样的作用,只不过是更加语义化了。 html5给我们增加了许多语义化的标签,比如header、footer、nav、main、article、aside等,这些标签和div有同样的作用,只不过是更加语义化了。兼容性问题主流的浏览器对HTML5和...
2018-12-04 18:11:39 7657
原创 python3的zip函数和zip(*)函数
python3的zip函数和zip(*)函数一. python3中的zip函数zip函数接受任意多个可迭代对象作为参数,将对象中对应的元素打包成一个tuple,然后返回一个可迭代的zip对象.这个可迭代对象可以使用循环的方式列出其元素.若多个可迭代对象的长度不一致,则所返回的列表与长度最短的可迭代对象相同.用法1:用两个列表生成一个zip对象例一:>>&g...
2018-12-04 15:55:23 1086
原创 JavaScript里的值类型和引用类型
JavaScript里的变量类型按存储方式分为值类型和引用类型。如果是引用类型,则比较的是地址。console.log([1,2] === [1,2]) //falseconsole.log({1:'1'} === {1: '1'}) //false如果是值类型,则比较的是内容。console.log(1 === 1) //true举例验证:...
2018-12-03 21:45:23 192
原创 Valid Sudoku
题目链接Determine if a 9x9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules:Each row must contain the digits 1-9 without repetition.Each column must c...
2018-12-03 20:25:12 309
java设计模式
2016-10-06
关于web开发中的响应式布局
2016-11-19
TA创建的收藏夹 TA关注的收藏夹
TA关注的人