随笔分类 -  Coursera

coursera review---algorithms,Stanford---04---BFS & DFS
摘要:1 #include 2 #include 3 #include 4 #include 5 6 using namespace std; 7 8 typedef map > graphType; 9 10 void BFS(graphType graph, int starter, map & visitTime) {11 queue Q;12 Q.push(starter);13 map visited;14 for (auto i : graph) {15 visited[i.first] = false;16 }17 ... 阅读全文

posted @ 2013-08-18 10:19 haoyancoder 阅读(179) 评论(0) 推荐(0)

coursera review---algorithms,Stanford---03---master method
摘要:the master methodprovides a cookbook solution inasymptoticterms (usingBig O notation) forrecurrence relationsof types that occur in theanalysisof manydivide and conquer algorithmsthe following is the simplified expression:a = number of recursive calls,(>=1)b = input size shrink factor,(>1)d = 阅读全文

posted @ 2013-08-17 16:38 haoyancoder 阅读(384) 评论(0) 推荐(0)

coursera review---algorithms,Stanford---02---quick sort
摘要:the idea of quick sort is:choose a pivot(randomly or simply)partition the array into a[0,1,...,pivot-1],a[pivot],a[pivot+1,...,end] that all elements ina[0,1,...,pivot-1] = a[pivot]quick sorta[0,1,...,pivot-1]quick sorta[pivot+1,...,end] 1 void swap(int a[], int i, int j) { 2 int temp = a[i]; 3 ... 阅读全文

posted @ 2013-08-17 16:20 haoyancoder 阅读(248) 评论(0) 推荐(0)

coursera review---algorithms,Stanford---01---merge sort
摘要:merge sort is a typical divide & conquer algorithm,merge is this algorithm's core subroutine,merge:merge two sorted subarrays into one sorted arraymergeSort:divide input array to two subarrays leftArray and rightArraymergeSort(leftArray);mergeSort(rightArray);merge these two subarrays 1 // m 阅读全文

posted @ 2013-08-16 22:21 haoyancoder 阅读(213) 评论(0) 推荐(0)

coursera
摘要:Machine Learning------Andrew Ng------Stanford University------https://www.coursera.org/course/mlAlgorithms:Design and Analysis,Part 1------Tim Roughgarden------Stanford University------https://www.coursera.org/course/algoCoding the Matrix:Linear Algebra through Computer Science Applications------Phi 阅读全文

posted @ 2013-08-14 22:26 haoyancoder 阅读(196) 评论(0) 推荐(0)

导航