上一页 1 2 3 4 5 6 7 ··· 9 下一页
  2017年7月16日
摘要: 同样的程序代码,使用Visual Studio 进行编译,当目标平台分别为x86或x64环境时,其编译结果是不同的。在x86环境下,指针都是4个字节的;而在x64环境下,指针都是8字节的。测试代码如下: include using namespace std; int main(int argc, 阅读全文
posted @ 2017-07-16 11:16 HorseShoe2016 阅读(1794) 评论(0) 推荐(0)
  2017年4月2日
摘要: 原题链接 "矩形分割" 算法分析: 解决该题要用到“并查集”的思想。 这里有一篇不错的博客介绍并查集: "并查集(Union Find)算法介绍" 记 int total=N M,这里会有 total 个方块,因为一道对角线('\'或者'/')会把一块方块分割为左右两部分,所以,我们把任意一块方块看 阅读全文
posted @ 2017-04-02 18:59 HorseShoe2016 阅读(458) 评论(0) 推荐(0)
摘要: 原题链接 "一面砖墙" 算法分析 设墙的宽度为 range,则需要统计横坐标为 1,2,3,4,...,range 1 处的墙缝数,取最大的墙缝数(记为maxCrevices),从该处划一道竖线,竖线穿过的砖块数据最少,为N maxCrevices;当然,输数据中不可能所有的坐标处都有裂缝,所以,我 阅读全文
posted @ 2017-04-02 18:04 HorseShoe2016 阅读(323) 评论(0) 推荐(0)
  2017年3月28日
摘要: hihocoder 1014: Trie树 原题链接: "http://hihocoder.com/problemset/problem/1014" 算法分析 解决该题需要构造一个Trie类,用来对输入的每一个字符串进行统计。 该Trie类每个实例表示一个Trie树的节点,每个节点有26个“槽”,表 阅读全文
posted @ 2017-03-28 21:39 HorseShoe2016 阅读(291) 评论(0) 推荐(0)
  2017年3月27日
摘要: hihocoder 1485:hiho字符串 描述如果一个字符串恰好包含2个& 39;h& 39;、1个& 39;i& 39;和1个& 39;o& 39;,我们就称这个字符串是hiho字符串。  例如"oihateher"、"hugeinputhugeoutp 阅读全文
posted @ 2017-03-27 12:30 HorseShoe2016 阅读(640) 评论(0) 推荐(0)
  2017年3月26日
摘要: Given a binary tree, return the values of its boundary in anti clockwise direction starting from root. Boundary includes left boundary, leaves, and ri 阅读全文
posted @ 2017-03-26 12:00 HorseShoe2016 阅读(1140) 评论(0) 推荐(0)
  2017年3月19日
摘要: During the NBA playoffs, we always arrange the rather strong team to play with the rather weak team, like make the rank 1 team play with the rank nth 阅读全文
posted @ 2017-03-19 11:17 HorseShoe2016 阅读(463) 评论(0) 推荐(0)
摘要: Given a matrix consists of 0 and 1, find the distance of the nearest 0 for each cell. The distance between two adjacent cells is 1. Example 1: Input: 阅读全文
posted @ 2017-03-19 11:07 HorseShoe2016 阅读(373) 评论(0) 推荐(0)
摘要: Given a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus sum of all 阅读全文
posted @ 2017-03-19 11:01 HorseShoe2016 阅读(902) 评论(0) 推荐(0)
摘要: Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the longest path betwe 阅读全文
posted @ 2017-03-19 10:58 HorseShoe2016 阅读(677) 评论(0) 推荐(0)
  2017年3月12日
摘要: 536. Construct Binary Tree from String You need to construct a binary tree from a string consisting of parenthesis and integers. The whole input repre 阅读全文
posted @ 2017-03-12 22:22 HorseShoe2016 阅读(988) 评论(0) 推荐(0)
摘要: 527. Word Abbreviation Given an array of n distinct non empty strings, you need to generate minimal possible abbreviations for every word following ru 阅读全文
posted @ 2017-03-12 21:59 HorseShoe2016 阅读(747) 评论(0) 推荐(0)
  2017年3月6日
摘要: 问题描述 Given a picture consisting of black and white pixels, and a positive integer N, find the number of black pixels located at some specific row R an 阅读全文
posted @ 2017-03-06 12:09 HorseShoe2016 阅读(689) 评论(0) 推荐(0)
摘要: 问题描述 In the video game Fallout 4, the quest "Road to Freedom" requires players to reach a metal dial called the "Freedom Trail Ring", and use the dial 阅读全文
posted @ 2017-03-06 11:30 HorseShoe2016 阅读(535) 评论(0) 推荐(0)
  2017年3月5日
摘要: Lonely Pixel I 两种算法之间的性能比较 今天参加LeetCode Weekly Contest 22,第二题 "Lonely Pixel I" 问题描述如下: Given a picture consisting of black and white pixels, find the 阅读全文
posted @ 2017-03-05 19:59 HorseShoe2016 阅读(1198) 评论(0) 推荐(0)
  2017年2月27日
摘要: 新建了一个Android Studio工程,在MainActivity的主界面中添加了两个按钮,点击其中一个按钮用来启动 NormalActivity,点击另一按钮用来启动DialogActivity. 其中,NormalActivity和DialogActivity都是很简单的界面,只是在Andr 阅读全文
posted @ 2017-02-27 21:03 HorseShoe2016 阅读(4927) 评论(1) 推荐(1)
  2017年2月12日
摘要: 问题描述 You need to find the largest element in each row of a Binary Tree. Example: Input: 1 / \ 2 3 / \ \ 5 3 9 Output: [1, 3, 9] 算法分析 使用两个队列,逐层遍历二叉树的各个 阅读全文
posted @ 2017-02-12 15:54 HorseShoe2016 阅读(235) 评论(0) 推荐(0)
摘要: ####问题描述 Given a binary tree, find the left most element in the last row of the tree. #####Example 1: Input: 2 / \ 1 3 Output: 1 #####Example 2: Input 阅读全文
posted @ 2017-02-12 15:44 HorseShoe2016 阅读(319) 评论(0) 推荐(0)
  2016年12月31日
摘要: 宿主机无法访问虚拟机中的web服务 在Windows7宿主机中的VMware虚拟机中安装了CentOS6.5操作系统,并且基于Nginx搭建了Web服务器,网页刚刚搭建好的时候,通过宿主机的浏览器可以访问虚拟机中的网页。但是过了一会儿,就无法访问了,这个问题困扰了自己好几天,每次只好通过虚拟机快照返 阅读全文
posted @ 2016-12-31 12:07 HorseShoe2016 阅读(6150) 评论(0) 推荐(0)
  2016年12月29日
摘要: CentOS6.5系统下设置自己安装的程序开机自动启动 方法1. 把启动程序的命令添加到 /etc/rc.d/rc.local 文件中,比如设置开机启动 mysqld: !/bin/sh This script will be executed after all the other init sc 阅读全文
posted @ 2016-12-29 13:55 HorseShoe2016 阅读(10700) 评论(0) 推荐(1)
上一页 1 2 3 4 5 6 7 ··· 9 下一页