leetcode---Single Number---异或

Given an array of integers, every element appears twice except for one. Find that single one.Note: Your algorithm should have a linear runtime compl...

2016-09-29 21:52:38

阅读数:291

评论数:0

leetcode---Palindrome Partitioning---动规、回溯

Given a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindrome partitioning of s.For example...

2016-09-28 21:57:47

阅读数:213

评论数:0

Raft一致性算法

每个结点都只能是以下3种状态中的一种: 1、领导者 2、候选者 3、跟随者状态转换: 跟随者只能回应其它服务器的请求。如果一个跟随者收不到信息,则变为候选者,发起选举。一个候选者如果获得大多数选票,则成为新的领导者,直到它失效。Raft确保任何时期,都满足: 1、选举安全:给定时期内...

2016-09-28 18:26:51

阅读数:290

评论数:0

leetcode---Surrounded Regions---广搜

Given a 2D board containing ‘X’ and ‘O’ (the letter O), capture all regions surrounded by ‘X’.A region is captured by flipping all ‘O’s into ‘X’s in ...

2016-09-27 14:15:46

阅读数:178

评论数:0

leetcode---Sum Root to Leaf Numbers---树的深度遍历

Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.An example is the root-to-leaf path 1->2->...

2016-09-26 20:27:30

阅读数:189

评论数:0

leetcode---Best Time to Buy and Sell Stock II---贪心

Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may comple...

2016-09-25 20:02:29

阅读数:195

评论数:0

leetcode---Triangle---动规

Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the fo...

2016-09-24 18:15:20

阅读数:197

评论数:0

leetcode---Flatten Binary Tree to Linked List

Given a binary tree, flatten it to a linked list in-place.For example, Given 1 / \ 2 5 / \ \ 3 4 6 The flattened tree should l...

2016-09-24 17:29:32

阅读数:392

评论数:0

linux---磁盘与文件系统管理

查看/ /boot /home 三个目录所对应的inode:前2个为2,最后一个为390916 列出整体磁盘使用量 列出目录/etc容量 将可用inode数量列出 检查目录下每个目录所占容量,单位KB 查看系统内所有partition 系统有一颗盘,磁盘文件名为/de...

2016-09-24 17:26:31

阅读数:292

评论数:0

leetcode---Path Sum II---回溯

Given a binary tree and a sum, find all root-to-leaf paths where each path’s sum equals the given sum.For example: Given the below binary tree and s...

2016-09-21 22:05:36

阅读数:255

评论数:0

leetcode---Convert Sorted List to Binary Search Tree---二叉搜索树

Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST./** * Definition for singly-linked list...

2016-09-20 20:38:23

阅读数:432

评论数:0

leetcode---Convert Sorted Array to Binary Search Tree---二叉搜索树

Given an array where elements are sorted in ascending order, convert it to a height balanced BST./** * Definition for a binary tree node. * struct ...

2016-09-19 17:10:59

阅读数:188

评论数:0

Linux---文件与目录管理

切换目录 change directory 显示当前目录 print working directory 创建目录 make directory 创建权限为 rwx–x–x的目录 删除目录 remove directory 删除test以及test文件夹下所有内容 列出全部文...

2016-09-18 09:44:23

阅读数:204

评论数:0

leetcode---Construct Binary Tree from Inorder and Postorder Traversal

Given inorder and postorder traversal of a tree, construct the binary tree./** * Definition for a binary tree node. * struct TreeNode { * int ...

2016-09-17 18:16:26

阅读数:219

评论数:0

Linux---文件与目录权限

1、改变文件所属用户组:chgrp users install.log 将install.log用户组改为users,但users必须存在于/etc/group中才可以。2、改变文件所有者:chown bin install.log 将install.log所有者改为bin,但bin必须存在...

2016-09-17 16:44:48

阅读数:205

评论数:0

Linux---基本命令

列出所有“自己主文件夹(~)”下的“所有隐藏文件与相关的文件属性” 显示日期与时间 列出日历 计算器 命令补全:命令后面跟2个TAB 停止:Ctrl + C 退出:Ctrl + D 在线帮组:man 退出在线帮助:q 关机:shutdown -h now 现在关机; shutdo...

2016-09-17 15:18:52

阅读数:242

评论数:0

CentOS---图形界面和命令行切换

按Ctrl+Alt+F2到命令行界面。按Ctrl+Alt+F1到图形界面。

2016-09-17 14:11:46

阅读数:5518

评论数:0

leetcode---Construct Binary Tree from Preorder and Inorder Traversal---树的构建

Given preorder and inorder traversal of a tree, construct the binary tree./** * Definition for a binary tree node. * struct TreeNode { * int v...

2016-09-16 21:48:14

阅读数:249

评论数:0

leetcode---Binary Tree Zigzag Level Order Traversal---层次遍历

Given a binary tree, return the zigzag level order traversal of its nodes’ values. (ie, from left to right, then right to left for the next level and...

2016-09-14 22:27:16

阅读数:231

评论数:0

leetcode---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 ...

2016-09-13 22:12:52

阅读数:139

评论数:0

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