• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
neverlandly
博客园    首页    新随笔    联系   管理    订阅  订阅

随笔分类 -  Summary

上一页 1 2 3 下一页
Leetcode: Implement Trie (Prefix Tree) && Summary: Trie

摘要:参考百度百科:Trie树 a trie, also called digital tree and sometimes radix tree or prefix tree (as they can be searched by prefixes) The time complexity to ins 阅读全文
posted @ 2015-12-16 13:45 neverlandly 阅读(529) 评论(0) 推荐(0)
Lintcode: Singleton && Summary: Synchronization and OOD

摘要:Singleton is a most widely used design pattern. If a class has and only has one instance at every moment, we call this design as singleton. For exampl... 阅读全文
posted @ 2015-04-21 04:28 neverlandly 阅读(1828) 评论(0) 推荐(1)
转载:如何在面试中写出好的代码

摘要:一下都是我面试的经验和教训,欢迎各位大牛指正或者补充 1. 写代码之前,大脑里面要有个whole picture,不能想到哪儿写到哪儿。是你的大脑在写代码,而不是白板上你的手在代码。你的手只是一个printer里面的喷头而已,是它把你大脑里面的代码print到白板上,你的大脑才是控制那个喷头的芯片。 阅读全文
posted @ 2015-03-19 03:55 neverlandly 阅读(1769) 评论(0) 推荐(1)
VMware Coding Challenge: Possible Scores && Summary: static

摘要:Combination Sum I 那道题的变体 1 /* 2 * Complete the function below. 3 */ 4 5 static int is_score_possible(int score, int[] increments) { 6 A... 阅读全文
posted @ 2015-02-27 12:22 neverlandly 阅读(429) 评论(0) 推荐(0)
Summary: rand5构造rand7

摘要:给一个方法,比如 rand5(), 它能够等概率生成 1-5 之间的整数。 所谓等概率就是1,2,3,4,5 生产的概率均为 0.2 。现在利用rand5(), 构造一个能够等概率生成 1- 7 的方法。这里有两个特别重要的点,一是 如果 rand5() + rand5(), 我们能够产生一个均匀分... 阅读全文
posted @ 2015-02-21 04:37 neverlandly 阅读(524) 评论(0) 推荐(0)
Summary: 书架问题

摘要:Consider the problem of storing n books on shelves in a library. The order of the books is fixedby the cataloging system and so cannot be rearraged. T... 阅读全文
posted @ 2015-02-10 05:29 neverlandly 阅读(888) 评论(0) 推荐(0)
Summary: sorting Algorithms

摘要:Insertion sortis a simplesorting algorithmthat builds the finalsorted array(or list) one item at a time. It is much less efficient on large lists than... 阅读全文
posted @ 2015-02-08 12:01 neverlandly 阅读(366) 评论(0) 推荐(0)
Lintcode: Heapify && Summary: Heap

摘要:Heap的介绍1,介绍2,要注意complete tree和full tree的区别, Heap是complete tree;Heap里面 i 的 children分别是 i*2+1 和 i*2+2,i 的 parent是 (i-1)/2 Heapify的基本思路就是:Given an array 阅读全文
posted @ 2015-02-08 06:57 neverlandly 阅读(2042) 评论(0) 推荐(0)
Lintcode: Hash Function && Summary: Modular Multiplication, Addition, Power && Summary: 长整形long

摘要:In data structure Hash, hash function is used to convert a string(or any other type) into an integer smaller than hash size and bigger or equal to zer... 阅读全文
posted @ 2015-02-07 07:06 neverlandly 阅读(1765) 评论(1) 推荐(0)
Summary: Lowest Common Ancestor in a Binary Tree & Shortest Path In a Binary Tree

摘要:转自:Pavel's BlogNow let's say we want to find the LCA for nodes 4 and 9, we will need to traverse the whole tree to compare each node so that we can lo... 阅读全文
posted @ 2015-02-01 13:25 neverlandly 阅读(535) 评论(0) 推荐(0)
Summary: Prime

摘要:最近遇到很多问题都跟Prime有关,于是总结一下:Prime definition:Aprime number(or aprime) is anatural numbergreater than 1 that has no positivedivisorsother than 1 and itsel... 阅读全文
posted @ 2015-02-01 06:12 neverlandly 阅读(489) 评论(0) 推荐(0)
Summary: Java Inheritance

摘要:In this tutorial we will discuss about the inheritance in Java. The most fundamental element of Java is the class. A class represents an entity and al... 阅读全文
posted @ 2015-01-29 14:27 neverlandly 阅读(411) 评论(0) 推荐(0)
Summary: difference between public, default, protected, and private key words

摘要:According to Java Tutorial:Controlling Access to Members of a ClassAccess level modifiers determine whether other classes can use a particular field o... 阅读全文
posted @ 2015-01-29 14:20 neverlandly 阅读(333) 评论(0) 推荐(0)
Summary: Arrays vs. Collections && The differences between Collection Interface and Collections Class

摘要:转自http://www.anylogic.com/anylogic/help/index.jsp?topic=/com.xj.anylogic.help/html/code/Arrays_Collections.htmlJava offers two types of constructs whe... 阅读全文
posted @ 2015-01-29 09:00 neverlandly 阅读(301) 评论(0) 推荐(0)
Summary: Stack Overflow Error

摘要:What is a stack overflow error?Parameters and local variables are allocated on the stack (with reference types the object lives on the heap and a vari... 阅读全文
posted @ 2015-01-22 06:47 neverlandly 阅读(338) 评论(0) 推荐(0)
Twitter OA prepare: Rational Sum

摘要:In mathematics, a rational number is any number that can be expressed in the form of a fraction p/q , where p & q are two integers, and the denominato... 阅读全文
posted @ 2015-01-04 08:30 neverlandly 阅读(500) 评论(0) 推荐(0)
Java: Best Way to read a file

摘要:经常在各种平台的online test里面不熟悉STDIN, STOUT,下面举个例子: Input Format There are three lines of input: The first line contains an integer. The second line contains 阅读全文
posted @ 2015-01-04 08:18 neverlandly 阅读(246) 评论(0) 推荐(0)
Summary: gcd最大公约数、lcm最小公倍数算法

摘要:欧几里德算法欧几里德算法又称辗转相除法,用于计算两个整数a,b的最大公约数。其计算原理依赖于下面的定理:定理:gcd(a,b) = gcd(b,a mod b)证明:a可以表示成a = kb + r,则r = a mod b假设d是a,b的一个公约数,则有d|a, d|b,而r = a - kb,因... 阅读全文
posted @ 2015-01-03 23:42 neverlandly 阅读(1425) 评论(0) 推荐(0)
Summary: Class Variable vs. Instance Variable && Class Method

摘要:这里列举的是一些我平时碰到的一些Java Grammar,日积月累。Class Variable vs Instance Variable:Instance variablesInstance variable is the variable declared inside a class, but... 阅读全文
posted @ 2014-11-22 11:58 neverlandly 阅读(512) 评论(0) 推荐(0)
Leetcode: LRU Cache

摘要:难度:90。这是一道非常综合的题目,主要应用在操作系统的资源管理中。 按照题目要求,要实现get和set功能,为了满足get功能:随机访问的需求(lookup)我们首先想到的一般是用数组,如果用链表会有O(n)的访问时间。然而他又有另一个条件就是要维护least used的队列,也就是说经常用的放在 阅读全文
posted @ 2014-09-21 05:31 neverlandly 阅读(720) 评论(0) 推荐(0)

上一页 1 2 3 下一页
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3