
Algorithm
文章平均质量分 56
0TST0
whu-cs硕士在读
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Algorithm-Arrays-1
Min steps in infinite grid原创 2017-06-14 11:58:04 · 174 阅读 · 0 评论 -
搜索算法--线性搜索、二分搜索、内插搜索、剪枝搜索
线性搜索 二分搜索 内插搜索 剪枝搜索原创 2017-07-28 20:59:52 · 1790 阅读 · 0 评论 -
Algorithm-Arrays-8 Noble Integer
1. 题目描述 Given an integer array, find if an integer p exists in the array such that the number of integers greater than p in the array equals to p If such an integer is found return 1 else return原创 2017-08-13 11:48:49 · 306 阅读 · 0 评论 -
Algorithm-Arrays-7 Diagonals 对角线输出
1. 题目 Give a N*N square matrix, return an array of its anti-diagonals. Look at the example for more details. Example: Input: 1 2 3 4 5 6 7 8 9 Return the following :原创 2017-08-13 11:17:07 · 250 阅读 · 0 评论 -
Algorithm-Arrays-6 Kth pascal triangle
1. 题目: Kth Row of Pascal’s Triangle此处有关于该问题的类似解法。 Given an index k, return the kth row of the Pascal’s triangle. Pascal’s triangle : To generate A[C] in row R, sum up A’[C] and A’[C-1] from prev原创 2017-08-13 09:50:40 · 221 阅读 · 0 评论 -
Shell排序和插入排序
Shell排序算法本人部分理论内容参考自这里,感兴趣者可以直接在此处查看。 Shell sort is a sorting algorithm that requires asymptotically fewer than O(n²) comparisons and exchanges in the worst case. Although it is easy to devel原创 2017-07-27 15:04:29 · 328 阅读 · 0 评论 -
简单排序算法总结
1. 选择排序、插入排序、冒泡排序选择排序 The selection sort algorithm sorts an array by repeatedly finding the minimum element (considering ascending order) from unsorted part and putting it at the beginning. The al原创 2017-07-27 11:12:16 · 235 阅读 · 0 评论 -
10种排序算法总结
这里把常见的排序算法做个总结,包括 1). SelectSort–选择排序 2). InsertSort–插入排序 3). BubbleSort–冒泡排序 4). ShellSort–希尔排序 5). MergeSort–归并排序 6). QuickSort–快速排序 7). HeapSort–堆排序 8). CountSort–计数排序 9).原创 2017-08-17 10:54:20 · 453 阅读 · 1 评论 -
Algorithm-Arrays-5 Repeat and Missing Number Array
1. 问题 You are given a read only array of n integers from 1 to n. Each integer appears exactly once except A which appears twice and B which is missing. Return A and B. Note: Your al原创 2017-07-17 19:24:51 · 245 阅读 · 0 评论 -
Algorithm-Arrays-4 最大绝对距离Max Absolute Difference
1. 问题描述 You are given an array of N integers, A1, A2 ,…, AN. Return maximum value of f(i, j) for all 1 ≤ i, j ≤ N. f(i, j) is defined as |A[i] - A[j]| + |i - j|, where |x| denotes absolute value o原创 2017-07-17 16:56:03 · 652 阅读 · 0 评论 -
Algorithm Arrays-3 Max Sum Contiguous Subarray
连续子数组最大和原创 2017-06-14 19:29:52 · 286 阅读 · 0 评论 -
Algorithm-Arrays-2
Add One to Number原创 2017-06-14 16:15:34 · 177 阅读 · 0 评论 -
数据结构--队列实现栈&栈实现队列
1. 两个栈实现栈 1.这里使用的是ArrayDequeue, 而不是使用Stack,因为Stack 集合是在Java Collection Framework被淘汰的集合。 2. 这里push操作增加的元素放在stack1中; 3. 这里pop操作作用集合为stack2, 如果stack2为空,则将stack1中元素push到stack2中,然后再stack2进行pop()操作。原创 2017-08-21 15:45:36 · 460 阅读 · 0 评论