上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 37 下一页
摘要: 问题:将一个n元一维向量向左旋转i个位置。例如,当n=8且i=3时,向量abcdefgh旋转为defghabc。简单的代码使用一个n元中间量在n步内完成该工作,你能否仅使用数十个额外字节的存储空间,在正比于n的时间内完成向量的旋转? Brute Algorithm:将需要移动的字符串x前i个元素复制 阅读全文
posted @ 2017-09-11 17:20 immjc 阅读(172) 评论(0) 推荐(0) 编辑
摘要: Given an unsorted array of integers, find the length of longest continuous increasing subsequence. Example 1: Example 2: Note: Length of the array wil 阅读全文
posted @ 2017-09-11 10:45 immjc 阅读(144) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the preorder traversal of its nodes' values. For example:Given binary tree {1,#,2,3}, return [1,2,3]. 递归 迭代 阅读全文
posted @ 2017-09-10 11:16 immjc 阅读(115) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the inorder traversal of its nodes' values. For example:Given binary tree [1,null,2,3], return [1,3,2]. 递归 迭代 阅读全文
posted @ 2017-09-10 11:04 immjc 阅读(109) 评论(0) 推荐(0) 编辑
摘要: Given a Binary Search Tree and a target number, return true if there exist two elements in the BST such that their sum is equal to the given target. E 阅读全文
posted @ 2017-09-10 10:49 immjc 阅读(310) 评论(0) 推荐(0) 编辑
摘要: Given a binary search tree and the lowest and highest boundaries as L and R, trim the tree so that all its elements lies in [L, R] (R >= L). You might 阅读全文
posted @ 2017-09-10 10:14 immjc 阅读(345) 评论(0) 推荐(0) 编辑
摘要: Initially, there is a Robot at position (0, 0). Given a sequence of its moves, judge if this robot makes a circle, which means it moves back to the or 阅读全文
posted @ 2017-09-07 16:21 immjc 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 重点 一个可以被挂载的数据通常称为“文件系统, filesystem”而不是分区 (partition) 基本上 Linux 的传统文件系统为 Ext2 ,该文件系统内的信息主要有: superblock:记录此 filesystem 的整体信息,包括inode/block的总量、使用量、剩余量, 阅读全文
posted @ 2017-09-06 14:10 immjc 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 重点: 绝对路径:“一定由根目录 / 写起”;相对路径:“不由 / 写起,而是由相对当前目录写起”; 特殊目录有:., …, -, ~, ~account需要注意; 与目录相关的指令有:cd, mkdir, rmdir, pwd 等重要指令; rmdir 仅能删除空目录,要删除非空目录需使用“ rm 阅读全文
posted @ 2017-09-03 18:23 immjc 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 重点 Linux的每个文件中,可分别给予使用者、群组与其他人三种身份个别的 rwx 权限; 群组最有用的功能之一,就是当你在团队开发资源的时候,且每个帐号都可以有多个群组的支持; 利用ls -l显示的文件属性中,第一个字段是文件的权限,共有十个位,第一个位是文件类型, 接下来三个为一组共三组,为使用 阅读全文
posted @ 2017-09-03 17:30 immjc 阅读(145) 评论(0) 推荐(0) 编辑
上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 37 下一页