
Python
Seazzy5461
这个作者很懒,什么都没留下…
展开
-
LeetCode——Two Sum
LeetCode——Two SumGiven an array of integers, return indices of the two numbers such that they add up to a specific target.原创 2017-10-29 11:47:03 · 570 阅读 · 0 评论 -
在ubuntu下安装虚拟环境Virtualenv
Virtualenv可以为Python提供独立的运行环境,在一定程度上可解决解决依赖、版本以及间接权限等问题。virtualenvvirtualenv用于创建独立的Python环境,多个Python相互独立,互不影响,它能够: 1. 在没有权限的情况下安装新套件 2. 不同应用可以使用不同的套件版本 3. 套件升级不影响其他应用安装sudo apt-get insta...原创 2018-09-03 09:32:14 · 417 阅读 · 0 评论 -
LeetCode——Move Zeroes
LeetCode——Move Zeroes #283 Given an array nums, write a function to move all 0’s to the end of it while maintaining the relative order of the non-zero elements.for example, given nums = [0, 1,原创 2017-11-27 10:54:13 · 263 阅读 · 0 评论 -
LeetCode——Reverse Linked List
LeetCode——Reverse Linked List # 206 Reverse a singly linked list.这一题的目的是反转一个单链表。是对链表操作的一个经典题目。第一个想到的思路是利用一个栈。C++语言中用栈实现的话,我只能将val保存到栈中,因为指针的问题,我解决的不好,但是Java的话,因为不用指针,就可以轻松地写出来。所以下面两个版本,其实不太一样。P原创 2017-11-21 23:28:38 · 238 阅读 · 0 评论 -
LeetCode——Balanced Binary Tree
LeetCode——Balanced Binary Tree #110 Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as a binary tree in which the depth o原创 2017-11-15 23:12:58 · 280 阅读 · 0 评论 -
LeetCode——Min Stack
LeetCode——Min Stack # 155 Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) – Push element x onto stack.pop() – Removes the element on top原创 2017-11-20 10:38:01 · 270 阅读 · 0 评论 -
LeetCode——Maxium Depth of Binary Tree
LeetCode——Maxium Depth of Binary Tree # 104 Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthes原创 2017-11-14 11:44:44 · 295 阅读 · 0 评论 -
LeetCode——Best Time to Buy and Sell Stock
LeetCode——Best Time to Buy and Sell Stock # 121 Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one t原创 2017-11-18 22:39:00 · 276 阅读 · 0 评论 -
LeetCode——Subtree of Another
LeetCode——Subtree of Another Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of s is a tree consists of a原创 2017-11-12 23:06:08 · 269 阅读 · 0 评论 -
LeetCode——Climbing Stairs
LeetCode——Climbing Stairs # 70 You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to t原创 2017-11-01 22:32:12 · 255 阅读 · 0 评论 -
LeetCode——Merge Two Sorted Lists
LeetCode——Merge Two Sorted Lists #21 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.原创 2017-11-01 22:20:34 · 237 阅读 · 0 评论 -
LeetCode——Symmetric Tree
LeetCode——Symmetric Tree # 101 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:原创 2017-11-09 22:42:31 · 253 阅读 · 0 评论 -
DeepLearning——感知器
感知器原创 2017-11-09 14:13:43 · 327 阅读 · 0 评论 -
LeetCode——Single Numeber
LeetCode——Single Number # 136 Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Co原创 2017-11-07 21:47:08 · 236 阅读 · 0 评论 -
LeetCode——Valid Parenthese
Leetcode——Valid Parenthese #20 Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[’ and ‘]’, determine if the input string is valid.原创 2017-10-29 19:11:08 · 427 阅读 · 0 评论 -
Python-subprocess模块学习总结
subprocess模块学习总结 写这个是自己进行学习总结,是在参考其他一些博文或资料后自己总结的。原创 2017-10-21 14:57:31 · 430 阅读 · 0 评论 -
使用networkx中write_dot,to_agraph出现问题的解决方法
networkx-1.11中的draw_graphviz函数中存在一个小错误,该函数由graphviz绘图工具不再导入到networkx的顶级命名空间中。以下是解决方法In [1]: import networkx as nxIn [2]: G = nx.complete_graph(5)In [3]: from networkx.drawing.nx_agraph import gr...原创 2018-11-16 16:57:49 · 1827 阅读 · 0 评论