首页 > 其他 > 详细

Data Structure and Algorithm

时间:2017-12-28 10:13:49      阅读:220      评论:0      收藏:0      [点我收藏+]

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

原文:https://www.cnblogs.com/leiluoray/p/8129703.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!