2019S1学习笔记
lrr13
.
展开
-
AVL树的旋转的一点新理解
题目Click the AVL tree that results when 5, 3, 2, 6, 8, 9, 10, 17, 15, 14, 12 are inserted, in that order, into an initially empty tree.解题过程如下(字丑,方框表示异常点):在完成此题时,由于对AVL树的重平衡不熟悉,参考了网上一些文章,对AVL的旋转有了新的...原创 2019-05-03 16:50:40 · 165 阅读 · 0 评论 -
搜索算法总结
对最近学习的基础算法做一些总结,并举出一些相应的例子,仅此作为记录。减治法(Decrease-and-Conquer)减常因子二分查找(Binary Search):function BinSearch(A[0..n − 1], k) lo ← 0 hi ← n − 1 while lo ≤ hi do m ← ⌊(lo + hi)/2⌋ if A[m] = k then ...原创 2019-06-03 19:09:42 · 275 阅读 · 0 评论 -
其余算法总结
对最近学习的基础算法做一些总结,并举出一些相应的例子,仅此作为记录。递归法(Recursion)汉诺塔(Hanoi):function Hanoi(n, init, aux, fin) if n > 0 then Hanoi(n − 1, init, fin, aux) Move one disk from init to fin Hanoi(n − 1, aux, in...原创 2019-06-03 19:07:54 · 119 阅读 · 0 评论 -
计算机网络/物理层/延迟与带宽需求笔记
high bandwidth and high latency:Data tapes sent by courier are one example of a high bandwidth and high latency method of transporting data.low bandwidth and low latency:A LAN has low bandwidth an...原创 2019-06-02 20:36:43 · 399 阅读 · 0 评论 -
字符串算法总结
对最近学习的字符串相关算法作一些总结。1.蛮力法Pattern p: A string of m characters to search for.Text t: A long string of n characters to search in.for i ← 0 to n − m do j ← 0 while j < m and p[j] = t[i + j] do j...原创 2019-06-02 19:22:30 · 87 阅读 · 0 评论 -
动态规划基础题目(数组转换最少次数)
题目给出两个数组A,B,a可以通过增、删、改任意位置的操作去变成b,现在需要使用dp计算出a变为b的最少步数。例如:A[0, 1, 2, 3, 4] → B[0, 1, 3, 5] 需要两个操作。解法首先根据例子,制作出一个对应的表,如下:null01234null01234501012341210123...原创 2019-05-20 23:13:53 · 1458 阅读 · 0 评论 -
Horspools算法在二进制情况下的比较次数的公式猜想
题目How many character comparisons will be made by Horspool’s algorithm in searching for eachof the following patterns it the binary text of one million zeros?(a) 01001(b) 00010© 01111解法(a)01001...原创 2019-05-15 10:16:51 · 738 阅读 · 0 评论 -
Points of Distributed Databases
Distributed DatabaseADDGood fit for geographically distributed organizations / usersComplexity of management and controlData located near site with greatest demandData integrityFast...转载 2019-05-07 11:36:10 · 108 阅读 · 0 评论 -
Points of Transactions
Purposesusers need the ability to define a unit of workconcurrent access to data by >1 user or programConcurrent accessThe Lost Update problemThe Uncommitted Data problemDeadlock– T1 loc...转载 2019-05-08 18:45:11 · 93 阅读 · 0 评论 -
图类算法总结
对最近学习的基础算法做一些总结,并举出一些相应的例子,仅此作为记录。(未完待续…)1…图的遍历(Graph Traversal)DFS:function DFS(hV, Ei) mark each node in V with 0 count ← 0 for each v in V do if v is marked 0 then DfsExplore(v )functio...原创 2019-05-05 19:49:39 · 192 阅读 · 0 评论 -
排序算法总结
对最近学习的基础算法做一些总结,并举出一些相应的例子,仅此作为记录。1.蛮力法(Brute Force)选择排序,复杂度O(n^2):要注意的是已排序数组的情况function SelSort(A[0..n − 1]) for i ← 0 to n − 2 do min ← i for j ← i + 1 to n − 1 do if A[j] < A[min] then...原创 2019-05-05 19:49:00 · 153 阅读 · 0 评论 -
利用递归计算算最安全路线
之前的做作业遇到一道递归题,记录一下,题目如下:给出一个矩阵如图所示,有化学物质的标为1,空的标为0,使用递归算出从起点到终点经过的最少化学物质数量(假设只能往右走或往下走):解法1:解法1从起点开始算,当到终点时返回,每次寻找往右和往下最小的数去记录,实现伪代码如下:funciton MinNumOfCells(A[0..n-1][0..n-1]) return count(A[0...原创 2019-05-05 16:35:23 · 146 阅读 · 0 评论 -
java I/O stream review
便于温习查询import java.io.*; public class fileStreamTest { public static void main(String args[]) { try { byte bWrite[] = { 11, 21, 3, 40, 5 }; OutputStream os = new ...原创 2019-08-03 13:03:34 · 94 阅读 · 0 评论