自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

sunshine

不积跬步无以至千里

  • 博客(52)
  • 收藏
  • 关注

转载 Hadoop单机模式和伪分布式搭建教程CentOS

转载于http://blog.csdn.net/zhshulin/article/details/50410403#t6 按原作者方法,安装成功 首先说明一下:采用的是新装的CentOS的环境,利用xshell进行远程操作来搭建Hadoop单机模式,伪分布式和完全分布式的文档。环节都是一环套一环,有先后顺序存在。本人是在win8.1 64位系统环境下,并且安装的Cent OS也是64位,故所有相

2017-05-19 21:20:25 793

原创 keras安装配置centos版本

centos版本:安装theano 1.1下载theano的zip文件[https://github.com/Theano/Theano],解压到~/site-packages/theano目录下,并命名为theano 1.2命令行输入: python setup.py develop安装Keras 2.1下载keras的zip文件[https://github.com/fcho

2016-11-18 21:11:24 2432

原创 Keras安装配置 windows版本

windows版本:安装anaconda 相当于安装了python 以及各种包安装Keras 打开Anaconda Prompt,在命令行中输入“pip install keras”安装MinGW 接着上一步,在命令行输入“conda install mingw libpython”安装theano 4.1 删除 /Anaconda/Lib/site-packages中的the

2016-11-18 16:07:22 8768

原创 31. Next Permutation (python)

Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possible, it must rearrange it as the lowest possible or

2016-10-30 16:17:51 2104 1

原创 18. 4Sum (python)

Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target. Note: The solution se

2016-10-30 16:16:56 1030

原创 16. 3Sum Closest (python)

Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exactly

2016-10-30 16:16:08 481

原创 15. 3Sum (python)

Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. Note: The solution set must not contain dup

2016-10-30 16:15:26 541

原创 Ksum问题 (leetcode)

1,15,16,18 转载自:http://www.sigmainfy.com/blog/summary-of-ksum-problems.html 方法一:暴力搜索法 时间复杂度O(n^k) 方法二:排序 2sum:采用快速排序法,排序后采用前后指针。当和为target,则找到答案返回;当和大于target,时,右指针左移;当和小于target时,左指针右移。循环上述过程,若找到则返回,否

2016-10-30 16:14:36 465

原创 11. Container With Most Water (python)

Given n non-negative integers a1, a2, …, an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two lin

2016-10-30 16:13:40 352

原创 396. Rotate Function (python)

Given an array of integers A and let n to be its length. Assume Bk to be an array obtained by rotating the array A k positions clock-wise, we define a “rotation function” F on A as follow: F(k) = 0 *

2016-10-30 16:12:42 1254

原创 283. Move Zeroes (python)

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, 0, 3, 12], after calling your fun

2016-10-30 16:11:38 382

原创 219. Contains Duplicate II (python)

Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the difference between i and j is at most k. 题意:判断是

2016-10-30 16:11:05 635

原创 217. Contains Duplicate (python)

Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if every element

2016-10-30 16:10:26 389

原创 189. Rotate Array (python)

Rotate an array of n elements to the right by k steps. For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4]. Note: Try to come up as many solutions as you can,

2016-10-30 16:09:17 625

原创 169. Majority Element (python)

Majority Element Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that the array is non-empty and the majo

2016-10-30 16:08:15 642

原创 121. Best Time to Buy and Sell Stock (python)

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 transaction (ie, buy one and sell one share of the stock), d

2016-10-30 16:06:30 371

原创 119. Pascal's Triangle II (python)

Given an index k, return the kth row of the Pascal’s triangle. For example, given k = 3, Return [1,3,3,1]. Note: Could you optimize your algorithm to use only O(k) extra space? 题意:返回杨辉三角的k行 思路:和1

2016-10-30 16:05:46 342

原创 118. Pascal's Triangle (python)

Given numRows, generate the first numRows of Pascal’s triangle. For example, given numRows = 5, Return [ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1] ] 题意:每一层的第i个位置,等于上一层第i-1与第i

2016-10-30 16:04:38 1850

原创 88. Merge Sorted Array(python)

Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note: You may assume that nums1 has enough space (size that is greater or equal to m + n) to hold addition

2016-10-30 16:03:19 349

原创 66. Plus One (python)

Given a non-negative number represented as an array of digits, plus one to the number. The digits are stored such that the most significant digit is at the head of the list. 题意:给一个非负数,用数组表示,加1返回结果 思

2016-10-30 16:01:45 402

原创 27. Remove Element (python)

Given an array and a value, remove all instances of that value in place and return the new length. Do not allocate extra space for another array, you must do this in place with constant memory. The o

2016-10-30 16:00:56 766

原创 26. Remove Duplicates from Sorted Array (python)

Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra space for another array, you must do this in place with co

2016-10-30 15:58:23 2728

原创 1. Two Sum (python)

Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution. Example: Given nums = [2, 7,

2016-10-30 15:57:27 1966

转载 IMP-00017 Oracle数据库imp命令导入时1659错误处理

我自己也遇到类似的问题(IMP-00017: 由于 ORACLE 错误 1659, 以下语句失败: "CREATE TABLE "GZQD_TYFB_DYD),然后按照原博主的方法二,是可以的。——-20160929今儿在自己电脑上搭建开发环境,在给数据库导入表结构以及数据时报1659错误,错误内容如下: IMP-00017: 由于 ORACLE 错误 1659, 以下语句失败: “CREATE

2016-09-29 09:38:01 5822

原创 328. Odd Even Linked List (python)

Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the value in the nodes. You should try to do it in pl

2016-09-19 22:13:42 362

原创 148. Sort List (python)

Sort a linked list in O(n log n) time using constant space complexity. 思路:能够有O(n lgn)时间复杂度的算法为,快速排序,堆排序,归并排序,三者的空间复杂度分别为O(1), O(N),O(N) 其中归并排序,其的基本思路就是将数组分成二组A,B,如果这二组组内的数据都是有序的,那么就可以很方便的将这二组数据进行排序。如

2016-09-19 22:12:26 928

原创 147. Insertion Sort List (python)

Sort a linked list using insertion sort. 题意:采用插入排序法对链表进行排序 思路:类似于扑克牌按照从小到大插入,将第i个元素与左边已排序的元素比较,找到位置插入即可 排序方法可参考:http://blog.csdn.net/yang_yulei/article/details/27237641#comments 数组是将比要插入的元素大的数值往后移,

2016-09-19 22:11:41 1106

原创 143. Reorder List(python)

Given a singly linked list L: L0→L1→…→Ln-1→Ln, reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do this in-place without altering the nodes’ values. For example, Given {1,2,3,4}, reorder it to {1,4,

2016-09-18 22:11:48 440

原创 142. Linked List Cycle II(python)

Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Note: Do not modify the linked list. Follow up: Can you solve it without using extra space? Subscribe

2016-09-18 21:56:31 425

原创 109. Convert Sorted List to Binary Search Tree(python)

Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. 题意:将有序单链表转换成二叉搜索树 思路:采用递归的思想,寻找中点构造二叉搜索树,左子树和右子树分别递归即可,注意递归停止的条件:无结点或者只有一个叶子结点 注意:无结点时返回

2016-09-18 21:55:07 452

原创 92. Reverse Linked List II(python)

Reverse a linked list from position m to n. Do it in-place and in one-pass. For example: Given 1->2->3->4->5->NULL, m = 2 and n = 4, return 1->4->3->2->5->NULL. Note: Given m, n satisfy the follow

2016-09-18 21:54:15 335

原创 86. Partition List(python)

Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve the original relative order of the nodes in each of th

2016-09-18 21:53:13 425

原创 82. Remove Duplicates from Sorted List II(python)

Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. For example, Given 1->2->3->3->4->4->5, return 1->2->5. Given 1->1->1-

2016-09-18 21:52:00 284

原创 61. Rotate List(python)

Given a list, rotate the list to the right by k places, where k is non-negative. For example: Given 1->2->3->4->5->NULL and k = 2, return 4->5->1->2->3->NULL. 题意:链表向右移动K位 Runtime: 42 ms 思路: 获取链表

2016-09-18 21:50:31 316

原创 2、add two numbers(python)

You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linke

2016-09-18 21:49:47 1767

原创 237. Delete Node in a Linked List(python)

Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Supposed the linked list is 1 -> 2 -> 3 -> 4 and you are given the third node with value 3,

2016-09-18 21:47:47 664

原创 234. Palindrome Linked List(python)

Given a singly linked list, determine if it is a palindrome. Follow up: Could you do it in O(n) time and O(1) space? 题意:给定一个链表,判断其是否为回文链表 eg:1 2 3 2 1 or 1 2 2 1 思路:找到中心点,前后对比思路一:考虑到单链表缺失从后向前的信息(

2016-09-18 21:45:15 1011

原创 206. Reverse Linked List(python)

题意:翻转链表思路一:入栈出栈,利用数组模拟栈,入栈即每次在数组的开头加入数,出栈即从数组的开头开始 空间复杂度为O(n) Runtime: 76 ms思路二:头结点倒插,类似于思路一,原链表头结点依次插入新链表的开头,返回新链表 空间复杂度为O(1) Runtime: 68 ms思路三:递归!!!每一次递归返回的n中,需明白n指向返回的链表的头结点,这就是引入n的重要性 h和p仍为该循

2016-09-18 21:42:38 480

原创 203. Remove Linked List Elements(python)

Remove all elements from a linked list of integers that have value val. Example Given: 1 –> 2 –> 6 –> 3 –> 4 –> 5 –> 6, val = 6 Return: 1 –> 2 –> 3 –> 4 –> 5 Runtime: 156 ms 总结:建立虚表头,比较p.next,如果p.

2016-09-18 21:39:48 940

原创 160. Intersection of Two Linked Lists(python)

Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: A: a1 → a2 ↘

2016-09-18 21:38:02 966

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除