自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Xiaomao要学coding

prepare for job hunting ! Learn coding and algorithm!

  • 博客(33)
  • 资源 (9)
  • 收藏
  • 关注

原创 [cc]18.9中位数

Numbers are randomly generated and passed to a method. Write a program to find and maintain the median value as new values are generated.随机产生一些数传递给一个函数,写程序找出并维护这些数的中位数。maxheap and minheap的应用

2015-04-22 01:24:46 430

原创 Coding Question

面过的几家小公司,结果有好有坏,但是感觉自己基础还是很差,要学习的东西真是还有很多,总结一下做的不好的题目1 liveramp分析时间复杂度题目: n 个数,任意两个组成pair, 问所有pair再相加时间复杂度,题目明显引导你选O(n^2),但是其实O(n)就解决!2 6 degree 问题,求任意两个actors之间的degree之前看面经的时候有人说bfs就没多想,但

2015-04-16 11:06:12 389

原创 Remove duplicate 问题

leetcode上有四道题,主要是remove from linked list和array都是two pointer解决,要注意终止条件,还有移动指针时条件

2015-04-08 05:44:29 909

原创 18.3shuffle cards

洗牌

2015-04-08 04:41:12 558

原创 17.9设计一个函数,找到给定单词在一本书中的出现次数

cc 17.9 hashtable应用首先需要考虑这个函数被调用的次数,如果只查询一次,直接遍历整本书,计算给定单词次数。时间只能是O(N)。正常情况下通常需要可以多次调用这样pre-processing the book,use hashtable to store word, frequency. then we can easily look up by O(1) tim

2015-04-08 01:15:02 787

原创 [cc]17.10 print encoded version of an XML element

Question: 17.10 按照新的要求encode xmlgiven a way of encoding XML where each tag gets mapped to a pre-defined integer value. language/grammar is as follows:Element --> Tag Attributes END Children EN

2015-04-07 05:32:47 402

原创 Top K frequency 系列

似乎这类问题还是满经常被遇到的,一直不是特别会,决定把这类问题做一个总结,如果遇到新的时时更新加进来idea: 通常hashmap 来记录 统计频率然后minheap(priorityqueue), 这里用minheap而通常不用maxheap,因为frenquency 最小的会在上面,比较和替换比较方便,如果next比当前top k中最小的大,则replace with top and

2015-04-06 14:20:35 443

原创 Binary Tree & BST

1 二叉树:Euler tour:

2015-04-06 07:05:22 491

原创 LinkedList

LinkedList easy to expend, such as insert or deleteeach element is a separate object : Nodedisadvantage: need more memory to store reference to next node( extra 4 bytes on 32-bit CPU)Two type:

2015-04-06 01:56:28 319

原创 [cc一百五]Unique char in String

Q1.1 Whether a string has all unique characters, if not use additional data structure

2015-04-01 00:14:32 467

原创 [phone]找连续字符组成的substring的组成char

其实是个很easy的问题,但是当时的code就是写的很垃圾,提示再三才写了这么一个code,应该还有可以improve的空间。典型的双指针问题,一前一后找substring,这里要考虑如何节省空间,尽可能的少存解。要求 one loop例如 abcdefg....xyzz input"thiisiissoodd", returns i i s o d input2 "thiiiss

2015-03-10 06:22:24 362

原创 Find next node in bst

碰到过好几次,interview常考高频题,面宝石家的时候这道题当时跪的很彻底,在小哥各种题目下才勉强写出来。其实大意就是找inorder traversal 里下一个,但是不需要得到所有inorder  结果geeksforgeek(1)有parent指针在cc150上有很好的讲解三种情况:i 当前node的right != null, 则返回leftmost of

2015-03-08 08:15:13 545

原创 Path Sum

最开始觉得很简单dfs的题,但是再做的时候才发现第一次做的时候很多问题并没有想清楚想明白结合面经把这道题重新做一遍。1 Path Sum from root to leafleetcode原题 pathsumiiGiven a binary tree and a sum, find all root-to-leaf paths where each path's sum equ

2015-03-08 06:50:05 317

原创 Find All local extrema

一个公司(名字就不提了)OA的题,做的时候觉得很简单,测试也过了,但后来还是挂了,当时没仔细想,后来看到有人po这道题,所以回来重新写一下,发现自己当时确实想错了。题目大意如下,就是找所有peak的总数,但是和leetcode那道peak的题目不同 1 有duplicate 2 需要找所有的peak之前总想着binary search,但是在这种情况下只能two pointer

2015-03-07 02:46:59 643

翻译 Probability of passing exam by guessing

Q37: Probability of passing exam by guessing10 multiple choice (abcd 4 choices) questions , pass = at least 5/10 questions are guessed correctly, how possible is that you can pass the exam just by g

2015-02-10 05:14:13 504

翻译 CC150 OOD Parking Lot

Design a parking lot using object- oriented principleshttps://github.com/gaylemcd/ctci/tree/master/java/Chapter%208/Question8_4首先: 需要和面试官讨论把问题具体化, 例如 可停的汽车类型, 是否是多层的parking lot 等等。然后做出如下假设(1

2015-02-04 12:01:24 9945

翻译 CC150 OOD question BlackJack

version 5 chapter 8 question 1https://github.com/gaylemcd/ctci/tree/master/java/Chapter%208/Question8_1题目是设计纸牌的数据结构,并且实现blackjack游戏首先确认设计为标准可拓展的cardsstandard 52 card set, It includes thi

2015-02-04 02:39:31 3734

原创 Flood fill Algorithm – how to implement fill() in paint?

http://www.geeksforgeeks.org/flood-fill-algorithm-implement-fill-paint/画板fill功能的实现,看描述第一反应是bfs遍历即可,但是这个算法似乎更多用dfs来实现dfs实现:根据gfg上的codepublic static void floodFill(int[][] screen , int x, int

2015-01-18 13:06:29 780

原创 Lexicographically minimum string rotation

http://geeksquiz.com/lexicographically-minimum-string-rotation/lexicographically字典序,在文本分析和搜索中有不少应用,比如在查询语句的预处理时,可以通过求得 lexicographic minimum,类似的查询就可以命中缓存,只在排序的时候考虑一下关键词在文档里的距离。gfg上给了一种最基础的做法,就

2015-01-17 13:44:48 1690

原创 中序表达式求值

Geeksforgeek上题目 http://geeksquiz.com/program-evaluate-simple-expressions/You are given a string that represent an expression of digits and operands. E.g. 1+2*3, 1-2+4. You need to evaluate the s

2015-01-17 06:26:04 1103

原创 Find common elements in three sorted arrays

Geeksforgeeeks上的一道题,原文http://www.geeksforgeeks.org/find-common-elements-three-sorted-arrays/iven three arrays sorted in non-decreasing order, print all common elements in these arrays.Exampl

2015-01-16 01:47:01 480

原创 A data structure for n elements and O(1) operations

GFG上的一道数据结构的题:http://geeksquiz.com/data-structure-n-elements-o1-operations/设计一个数据结构插入删除和查找都是O(1),存储 0 - n-1最初想法是hashtable类似,基于链表,但是查找不可能为O(1), 看了gfg上的讲解才豁然开朗。Solution:就是用一个数组实现,因为要存的数已

2015-01-15 14:17:00 366

原创 Design Pattern--Singleton

Design Pattern参考 ooDesignSingletonSingletons used for centralized management of internal or external resources(1 ) Only one instance of a class is created: it involves only one class which

2015-01-14 11:38:18 571

原创 Reverse String Question

Reverse String Question1 Reverse the string word by word (from leetcode)For example,Given s = "the sky is blue",return "blue is sky the".Clarification:What constitutes a word? A sequence

2015-01-14 08:17:41 368

原创 Implement Stack Using Queue

We are given a Queue data structure that supports standard operations like enqueue() and dequeue(). We need to implement a Stack data structure using only instances of Queuethis question is from Gee

2015-01-14 03:25:45 600

原创 hashtable HashMap相关问题

Rehash Question & hashfucntionhashtable相关问题,主要帮助理解hashtable

2015-01-14 01:05:25 537

原创 Factorial Trailing Zeros

leetcode questionGiven an integer n, return the number of trailing zeroes in n!.Your solution should be in logarithmic time complexity.need to pay attention basic situation is N <= 0, no zero!

2015-01-13 08:14:26 1432

原创 Partition Array/ Sort Color

Partition array 和leetcode中sort color的想法类似: 用two pointer, 一个start (= k),遇到不满足的就交换Partition Arrayquestion from lintcode

2015-01-11 02:35:18 479

原创 N sum Question

N sum Question2 sum,3 sum and 3 Sum closet4 sum - > K sum

2015-01-10 06:59:41 343

原创 Maximum Subarray问题

Maximum Subarray Difference(lintcode)

2015-01-08 03:51:43 1764 1

原创 文本编译器(汇编语言实现的)

这是一个文本编辑器的源码:读取字符宏定义     输入字符光标

2010-09-10 22:27:00 792

原创 关于SQLserver 2000的安装问题

2010-04-19 23:16:00 320

原创 Gridland acm

2010-01-29 15:56:00 534

图像匹配 sift算法

SIFT算法的matlab实现 SIFT算法基于图像特征尺度选择的思想,建立图像的多尺度空间,在不同尺度下检测到同一个特征点,确定特征点位置的同时确定其所在尺度,以达到尺度抗缩放的目的,剔出一些对比度较低的点以及边缘响应点,并提取旋转不变特征描述符以达到抗仿射变换的目的。该算法主要包含4个步骤: (1)建立尺度空间,寻找候选点; (2)精确确定关键点,剔除不稳定点; (3)确定关键点的方向; (4)提取特征描述符。

2012-04-25

汇编语言 翻转字符串 保护模式 源代码 .asm

32位 保护模式汇编语言 翻转字符串 源代码 .asm

2010-09-12

PHP mysql 操作自学视频

曹锟PHP自学视频系列 PHP+mysql 的操作 数据库连接 数据获取与导入等 适合于自己学习php的人 讲解简单易懂

2010-09-06

关于SQL2000 安装遇到挂起问题的解决方法

很多人在安装时遇到挂起操作提示时,进行不下去了,只能按确定退出安装。重启计算机后依然没用,还是有挂起提示。即使在HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager中找到PendingFileRenameOperations项目,并删除它。这样重新安装时还是会有挂起提示,实在郁闷!正确的做法应该是:

2010-08-25

ERIS 大赛 arcgis 软件安装指导

ERIS 大赛 arcgis desktop安装指导 详细版 ArcGIS是由ESRI出品的一个地理信息系统系列软件的总称。可以依不同应用平台分成以下版本: *桌面版本:以功能等级而区分的套件:ArcReader、ArcView、ArcEditor和ArcInfo,而高级的套件是较低级套件加上其他进阶功能。

2010-07-02

数据库系统概念第五版 课后习题答案 第一章

数据库系统概念第五版 课后习题答案 第一章

2010-07-02

数据库系统概念 第五版 课后答案

英文版 数据库系统概念第五版 课后习题答案 有助于大家自主学习

2010-07-02

Intel汇编语言程序设计作者库文件

Intel汇编语言程序设计第五版 作者库文件Irvine

2010-04-23

空空如也

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

TA关注的人

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