10 2015 档案
摘要:Divide-and-ConquerMaster methodAssumption:all subproblems has same sizeRecurrence FormatThe Master Method formulaRandomized AlgorithmsQuickSort (选取一个p...
阅读全文
摘要:Find thekth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.For exampl...
阅读全文
摘要:Given an integer array of sizen, find all elements that appear more than⌊ n/3 ⌋times. The algorithm should run in linear time and in O(1) space.如果没有这时...
阅读全文
摘要:Given an array of sizen, find the majority element. The majority element is the element that appears more than⌊ n/2 ⌋times.You may assume that the arr...
阅读全文
摘要:public class Solution { public ListNode addTwoNumbers(ListNode l1, ListNode l2) { ListNode cur1 = l1; ListNode cur2 = l2; ListNod...
阅读全文
摘要:用 Hash Table 实现Time : O(n)Space: O(n)import java.util.HashMap;public class Solution { public int[] twoSum(int[] nums, int target) { HashMap ...
阅读全文
摘要:Topic :The process abstractionDual-mode operationSafe control transferProcess 是对运行程序的抽象。a process is an instance of a program. (有一个 process control bl...
阅读全文
摘要:What is an Operating System?1. Referee – Manage sharing of resources, Protection, Isolation » Resource allocation, isolation, communication2. Illusi...
阅读全文
摘要:题目描述大概意思就是让你找出包含四个点以上的直线。Point API 的实现略(因为不熟悉 Java 的Comparator,是对着课件的模板写的。。。)Brute force 要求:The order of growth of the running time of your program sh...
阅读全文

浙公网安备 33010602011771号