Data Structure and Algorithm

Posted leiluoray

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Data Structure and Algorithm相关的知识,希望对你有一定的参考价值。

Array & ArrayList

String

LinkedList

Stack & Queue

Recursion

1. Knapsack non-repeating items.    Not Bug Free

  思路一:最直接的recursion.

public static boolean exist(int[] nums, int target, int index) {
    	 if (target == 0) {
	     return true;
	 }
	 if (index == nums.length || target < 0) {
	     return false;
	 }
	 return exist(nums, target - nums[index], index++) || exist(nums, target, index++);
    }

 

  

 

Tree & Graph

Binary Search

Sort

HashMap

 

以上是关于Data Structure and Algorithm的主要内容,如果未能解决你的问题,请参考以下文章

211. Add and Search Word - Data structure design

211 Add and Search Word - Data structure design

211. Add and Search Word - Data structure design

211. Add and Search Word - Data structure design

211. Add and Search Word - Data structure design

211. Add and Search Word - Data structure design