上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 15 下一页
摘要: 在c++中,没有java与python中定义的split()功能的函数,于是自己实现之。 情况1,适用范围,分隔符为字符。思路,记录分隔符的位置,判断需要截取的字符串的下标范围。 vector<string> split(string s,char ch){ int start=0; int len 阅读全文
posted @ 2016-03-06 13:52 ZHOU YANG 阅读(3508) 评论(0) 推荐(0)
摘要: Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array.Formally the function should:Return true if there exists i, j, k such that arr[i] & nums) { ... 阅读全文
posted @ 2016-03-05 22:37 ZHOU YANG 阅读(323) 评论(0) 推荐(0)
摘要: 1.配置集群机器之间ssh免密码登录 (1) ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa 将id_dsa.pub 公钥 加入授权的key中去 这条命令的功能是把公钥加到用于认证的公钥文件中,这里的authorized_keys 是用于认证的公钥文件 (2) ca 阅读全文
posted @ 2016-03-02 08:49 ZHOU YANG 阅读(365) 评论(0) 推荐(0)
摘要: 1.首先下载golang安装包,并配置好环境变量,此处略去相关操作,可能需要搭梯子。2.下载idea golang插件,并安装:下载地址如下:https://plugins.jetbrains.com/plugin/5047?pr=idea&showAllUpdates=true下载最新的插件,选择... 阅读全文
posted @ 2016-01-24 00:32 ZHOU YANG 阅读(11132) 评论(0) 推荐(0)
摘要: 在对numpy的数组进行操作时,我们应该尽量避免循环操作,尽可能利用矢量化函数来避免循环. 但是,直接将自定义函数应用在numpy数组之上会报错,我们需要将函数进行矢量化转换.def Theta(x): """ Scalar implemenation of the Heavisi... 阅读全文
posted @ 2016-01-23 16:48 ZHOU YANG 阅读(5224) 评论(0) 推荐(0)
摘要: 初学python,需要实现一个决策树,首先实践一下利用python实现一个二叉树数据结构。建树的时候做了处理,保证建立的二叉树是平衡二叉树。# -*- coding: utf-8 -*-from collections import dequeclass Node: def __init__... 阅读全文
posted @ 2016-01-14 16:13 ZHOU YANG 阅读(2869) 评论(0) 推荐(0)
摘要: Given an integer, write a function to determine if it is a power of three.Follow up:Could you do it without using any loop / recursion?思路1:利用递归函数解决问题,... 阅读全文
posted @ 2016-01-13 12:07 ZHOU YANG 阅读(278) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2016-01-12 15:52 ZHOU YANG 阅读(413) 评论(0) 推荐(0)
摘要: Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa... 阅读全文
posted @ 2016-01-11 23:35 ZHOU YANG 阅读(280) 评论(0) 推荐(0)
摘要: Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possibl... 阅读全文
posted @ 2016-01-10 22:59 ZHOU YANG 阅读(238) 评论(0) 推荐(0)
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 15 下一页