mrlonelyjtr's blog

写BUG的程序猿


  • Home

  • Categories

  • Archives

  • Tags

  • Search

【剑指Offer】二维数组中的查找

Posted on 2017-05-10 | In Algorithm , 剑指Offer
题目在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。 实现123456789101112131415public boolean Find(int target, int[][] a ...
Read more »

【剑指Offer】实现Singleton模式

Posted on 2017-05-08 | In Algorithm , 剑指Offer
题目设计一个类,我们只能生成该类的一个实例。 不好的解法一:只适用于单线程环境1234567891011121314public class Singleton1{ private static Singleton1 instance = null; private Singl ...
Read more »

【算法】图

Posted on 2017-04-16 | In Algorithm , Data Structure
union-find算法动态连通性 quick-find算法示意 实现123456789101112131415161718public void union(int p, int q){ int pID = find(p); int qID = find(q); if (pID == ...
Read more »

【算法】查找

Posted on 2017-04-15 | In Algorithm , Data Structure
顺序查找(无序链表)符号表中使用的数据结构的一个简单选择是链表,每个结点存储一个键值对。 示意 实现1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545 ...
Read more »

【算法】排序

Posted on 2017-04-12 | In Algorithm , Data Structure
选择排序首先,找到数组中最小的那个元素,其次,将它和数组的第一个元素交换位置(如果第一个元素就是最小元素那么它就和自己交换)。再次,在剩下的元素中找到最小的元素,将它与数组的第二个元素交换位置。如此往复,直到将整个数组排序。 示意 实现12345678910111213141516171819202 ...
Read more »

【算法】基础

Posted on 2017-04-12 | In Algorithm , Data Structure
链表链表是一种递归的数据结构,它或者为空(null),或者是指向一个结点(node)的引用,该结点含有一个泛型的元素和一个指向另一条链表的引用。 结点记录用一个嵌套类来定义结点的抽象数据类型。一个Node对象含有两个实例变量,类型分别为Item(参数类型)和Node。调用的结果是一个指向Node对象 ...
Read more »

[hihoCoder] Problem 1288 - Font Size

Posted on 2017-04-01 | In Algorithm
Steven loves reading book on his phone. The book he reads now consists of N paragraphs and the i-th paragraph contains ai characters. Steven wants to ...
Read more »

[LightOJ] Problem 1138 - Trailing Zeroes (III)

Posted on 2017-03-31 | In Algorithm , LightOJ
You task is to find minimal natural number N, so that N! contains exactly Q zeroes on the trail in decimal notation. As you know N! = 12…*N. For examp ...
Read more »

Torch Demo

Posted on 2017-03-17 | In Deep Learning
We have 5 steps to do in training a torch neural network. *(1) Load and normalize data; **(2) Define Neural Network; **(3) Define Loss function; **(4) ...
Read more »

Hello World

Posted on 2017-03-16
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in ...
Read more »
1…7778
mrlonelyjtr

mrlonelyjtr

间歇性踌躇满志,持续性混吃等死

780 posts
18 categories
18 tags
Github
© 2020 mrlonelyjtr
Powered by Hexo
Theme - NexT.Pisces