自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Joy Coder

用心去写代码!

  • 博客(21)
  • 资源 (1)
  • 收藏
  • 关注

原创 HashMap的简单实现,具有线程安全

hashmap实现

2015-08-21 11:49:48 1760

原创 死锁与饥饿

一、死锁 定义:一组相互竞争系统资源或进行通信的进程由于某种原因处于“永久”阻塞状态,不可解的循环等待。死锁存在的三个必要条件: 1、互斥:一次只有一个进程可以使用一个资源 2、占有且等待:当一个进程等待其他资源时,继续占有已经分配的资源 3、不可抢占:不能强行抢占进程已占有的资源 这三个条件都只是死锁存在的必要条件,但不是充分条件。对死锁的产生,还需要第四个条件: 4、循环等待:

2015-07-01 16:20:09 740

原创 Set Matrix Zeroes算法详解

题目:Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.click to show follow up.Follow up: Did you use extra space? A straight forward solution using O(mn) spa

2015-06-30 22:51:03 493

原创 Sqrt(x)算法详解

题目:Implement int sqrt(int x).Compute and return the square root of x.求x的开方牛顿迭代法求解: 计算x2 = n的解,令f(x)=x2-n,相当于求解f(x)=0的解,如左图所示。首先取x0,如果x0不是解,做一个经过(x0,f(x0))这个点的切线,与x轴的交点为x1。同样的道理,如果x1不是解,做一个经过(x1,f(x1))

2015-06-26 20:45:18 15509

原创 Count Complete Tree Nodes算法详解

题目:Given a complete binary tree, count the number of nodes.Definition of a complete binary tree from Wikipedia: In a complete binary tree every level, except possibly the last, is completely filled, a

2015-06-26 20:17:16 670

原创 Maximal Square算法详解

Given a 2D binary matrix filled with 0’s and 1’s, find the largest square containing all 1’s and return its area.For example, given the following matrix:1 0 1 0 0 1 0 1 1 1 1 1 1 1 1 1 0 0 1 0 Retu

2015-06-26 19:45:22 592

原创 Combination Sum算法详解

Combination Sum I: 算法题目:Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.The same repeated number may be chosen fro

2015-06-25 17:55:24 2245

原创 Unique Paths 算法详解

算法题目:A robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below).The robot can only move either down or right at any point in time. The robot is trying to reach the

2015-06-25 15:42:07 617

原创 Permutation Sequence算法详解

算法题目:The set [1,2,3,…,n] contains a total of n! unique permutations.By listing and labeling all of the permutations in order, We get the following sequence (ie, for n = 3):“123” “132” “213” “231”

2015-06-24 18:06:37 1110

原创 Multiply Strings

算法题目:Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-negative.大致意思:给定两个字符串数字num1,num2,数字可以无限大且非负,求这两个字符

2015-06-24 17:25:16 362

原创 Jump Game

算法题目:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Determine if yo

2015-06-23 20:13:41 397

原创 Read N Characters Given Read4算法详解

算法题目:The API: int read4(char *buf) reads 4 characters at a time from a file. The return value is the actual number of characters read. For example, it returns 3 if there is only 3 characters left in t

2015-06-23 17:36:26 642

原创 Two Sum III - Data structure design数据结构设计

算法题目:Design and implement a TwoSum class. It should support the following operations: add and find.add - Add the number to an internal data structure. find - Find if there exists any pair of numbers w

2015-06-23 17:07:32 1280

原创 Add Binary 算法详解

算法题目:Given two binary strings, return their sum (also a binary string).For example, a = “11” b = “1” Return “100”大致意思:二进制字符串的加法解题思路:可以用循环与递归来求解循环版本: string addBinary(string a, string b) {

2015-06-22 22:47:52 702

原创 Merge Sorted Array算法详解

算法题目:Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note: You may assume that nums1 has enough space (size that is greater or equal to m + n) to hold addit

2015-06-22 11:47:36 436

原创 Symmetric Tree算法详解

算法题目:Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: But the following is not: Note: Bonus points if you c

2015-06-22 10:57:28 523

原创 Balanced Binary Tree 算法详解

算法题目:Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never diffe

2015-06-21 16:03:06 1035

原创 Path Sum算法详解

算法题目:Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.For example: Given the below binary tree and su

2015-06-21 11:01:51 779

原创 操作系统概念及特征

本博客摘抄北大陈向群老师在Coursera上的公开课程:北大陈向群老师在Coursera上的公开课1. 什么是操作系统 操作系统是计算机系统中的一个系统软件,是一些程序模块的集合 (1)它们能以尽量有效、合理的方式组织和管理计算机的软硬件资源 (2)合理地组织计算机的工作流程,控制程序的执行并向用户提供各种服务功能 (3)使得用户能够灵活、方便地使用计算机,使整个计算机系统高效率运行

2015-06-20 22:42:52 866

原创 LeetCode:Valid Parentheses算法详解

算法题目:Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[’ and ‘]’, determine if the input string is valid. The brackets must close in the correct order, “()” 、 “()[]{}” and “([])[{()

2015-06-20 17:10:17 333

原创 LeetCode:Container With Most Water 算法题详解

算法题目:Given n non-negative integers a1, a2, …, an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find tw

2015-06-20 12:24:26 521

ds18b0在arm-linux上的驱动程序

在S3c2440上的ds18b20驱动程序哦!!

2013-02-08

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除