摘要:1、hashmap基本操作 2、hash function,equals函数,hashCode 3、练习题 1)Two Sum Given an array of integers, return indices of the two numbers suchthat they add up to
阅读全文
摘要:http://chenqx.github.io/2014/09/29/Algorithm-Recursive-Programming/ http://langgufu.iteye.com/blog/1168366
阅读全文
摘要:1/排序算法:冒泡排序bubble sort,插入排序 insertion sort,选择排序 selection sort,快速排序 quick sort,归并排序 merge sort;堆排序 heap sort 基于排序 桶排序bucket sort 一种特殊情况下的排序。 2/实现 1)冒泡
阅读全文
摘要:1、二叉树 完全二叉树(complete binary tree):除了最下面一层都是满的,最下面一层也是优先排列在左边。这样的话父亲节点和孩子节点就在序号上面有关系: 父亲节点为n,那么子节点的编号为2n和2n+1。这样就可以操作序号来操作完全二叉树。 A1 / \ B2 C3 / \ / \ D
阅读全文
摘要:1、问题描述: The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other. Given an integer n, ret
阅读全文
摘要:1、例题--排列 Permutation Given a collection of distinct numbers, return all possible permutations.For example,[1,2,3] have the following permutations:[1,2
阅读全文
摘要:1、链表数据结构 内存利用率高;动态分配 2、链表类定义 单向链表节点 public calss ListNode { int val =0; ListNode next = null; public void Node(int val_) { this.val = val_; this.next
阅读全文