随笔分类 - Data Structure
摘要:二叉树遍历 遍历命名 根据访问结点操作发生位置命名: ① NLR:前序遍历(Preorder Traversal 亦称(先序遍历)) ——访问根结点的操作发生在遍历其左右子树之前。 ② LNR:中序遍历(Inorder Traversal) ——访问根结点的操作发生在遍历其左右子树之中(间)。 ③
阅读全文
摘要:稀疏数组,作为压缩普通数组的一种方式 import java.util.Arrays; /** * 1、原数组的行数,列数,非0数据个个数 * 2、所有非0数据个坐标(row,column) */ public class SparseArray { public static int[][] toSparseArray(int[][] array) { /...
阅读全文
摘要:Queue定义,直接copyJava的Queue,去除了Collection接口。 ArrayQueue
阅读全文

浙公网安备 33010602011771号