- 博客(7)
- 资源 (3)
- 收藏
- 关注
原创 二叉排序树,AVL树,B树(多路查找树),B+树
一.二叉排序树 1.定义: 对于一颗二叉树,它的左子树若不为空,则左子树上所有结点的值小于它的根结点的值,若右子树不为空,则右子树上的所有结点的值大于它的根结点的值。且它的左右子树也分别为二叉排序树。 2.总结:二叉排序树是以链接的方式存储,保持了链接存储结构在执行插入或删除操作上不用移动元素的优点,只要找到合适的插入和删除位置后,仅需修改链接指针即...
2018-03-30 20:46:03
676
原创 二分查找
int BinSearch(int[] arr,int k){ if(arr == null || arr.length ==0) throw new RuntimeException(); int low,high,low; low=0; high=arr.length; while(low<=high) { ...
2018-03-30 19:29:48
223
原创 二叉树的遍历(递归与非递归实现)
二叉树的遍历(递归与非递归实现)二叉树的实现(三叉链表的形式)public class XieChaoThreeLinkBinTree<E> { public static class TreeNode<T> { T data; TreeNode<T> left; TreeNode<T...
2018-03-27 21:48:28
270
原创 LeetCode 169 Majority Element(Majority Voting Algorithm)
Majority ElementGiven an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the array is non-empty and the major...
2018-03-17 21:02:10
275
原创 LeetCode 695. Max Area of Island
LeetCode 695. Max Area of IslandGiven a non-empty 2D array grid of 0’s and 1’s, an island is a group of 1’s (representing land) connected 4-directionally (horizontal or vertical.) You may assume all...
2018-03-15 21:29:24
205
原创 LeetCode 485 Max Consecutive Ones
LeetCode 485 Max Consecutive OnesGiven a binary array, find the maximum number of consecutive 1s in this array.Example 1: Input: [1,1,0,1,1,1] Output: 3 Explanation: The first two digits or the...
2018-03-15 21:22:47
260
原创 LeetCode167 and 1 Two Sum
LeetCode Array 167 Two Sum II - Input array is sorted Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number.The ...
2018-03-15 21:11:32
252
蓝桥杯嵌入式2015年决赛
2017-03-10
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人