4 giới thiệu về các khái niệm lấy mẫu

Tài liệu Các khái niệm cơ bản của DB2: Giới thiệu về các kiểu dữ liệu có cấu trúc và các bảng được định kiểu pot

Tài liệu Các khái niệm cơ bản của DB2: Giới thiệu về các kiểu dữ liệu có cấu trúc và các bảng được định kiểu pot

Ngày tải lên : 22/02/2014, 15:20
... tính địa Mệnh đề VALUES bao gồm hàm lấy giá trị giá trị người sử dụng quy định cột OID, giá trị phải lấy cho kiểu REFERENCE bảng đích Theo mặc định, tên hàm lấy giá trị giống với tên kiểu liệu ... deptno, salary, perf_bonus, recog_award, address) values (engineer_t(1), 42 , 'Kidman', 'Jennifer', 'Z0 04' , 65000.00, 40 00.00, 2000.00, address_t() street('7 Dorval Rd') city('Markham') province('Ontario') ... SALARY PERF_BONUS RECOG_AWARD ADDRESS - - - -1 42 Kidman Z0 04 65000.00 40 00.00 2000.00 Dorva record(s) selected select oid, empno, lname, deptno, salary,...
  • 8
  • 829
  • 0
Các khái niệm cơ bản của DB2: Giới thiệu về các kiểu dữ liệu có cấu trúc và các bảng được định kiểu pps

Các khái niệm cơ bản của DB2: Giới thiệu về các kiểu dữ liệu có cấu trúc và các bảng được định kiểu pps

Ngày tải lên : 07/08/2014, 09:23
... tùy thuộc vào ứng dụng Chủ đề rộng phức tạp Bài viết giới thiệu cho bạn khái niệm kiểu liệu có cấu trúc, phân cấp kiểu bảng định kiểu, khái niệm làm rõ thông qua ví dụ thao tác, giúp bạn làm quen ... deptno, salary, perf_bonus, recog_award, address) values (engineer_t(1), 42 , 'Kidman', 'Jennifer', 'Z0 04' , 65000.00, 40 00.00, 2000.00, address_t() street('7 Dorval Rd') city('Markham') province('Ontario') ... SALARY ADDRESS - - - -1 42 Kidman 69 Theron Jennifer Maggie Z0 04 65000.00 Dorval Rd, Mark C012 49 000.00 River St, Ottaw record(s) selected select oid, empno,...
  • 18
  • 509
  • 0
Giới thiệu về các thuật toán -lec1

Giới thiệu về các thuật toán -lec1

Ngày tải lên : 15/11/2012, 10:24
... call(column3) is tottime(column2)/ncalls(column1) • cumtime(column4)includes subroutine calls • cumtime per call(column5) is cumtime(column4)/ncalls(column1) The profiling of the Bobsey vs Lewis document ... comparison is as follows: • Total: 195 secs • Get words from line list: 107 secs • Count-frequency: 44 secs • Get words from string: 13 secs • Insertion sort: 12 secs So the get words from line list ... the following steps: • Read file • Make word list [“the”,“year”, ] • Count frequencies [[“the” ,40 12],[“year”,55], ] • Sort into order [[“a”,3120],[“after”,17], ] • Compute θ Ideally, we would...
  • 7
  • 471
  • 1
Giới thiệu về các thuật toán -lec2

Giới thiệu về các thuật toán -lec2

Ngày tải lên : 15/11/2012, 10:24
... O(g(n)) if ∃ n0 , ∃ c s.t ≤ T (n) ≤ c.g(n) ∀n ≥ n0 Substituting for n0 , we have ≤ 4n2 − 2n + ≤ 26n2 ∀n ≥ ∴ 4n2 − 2n + = O(n2 ) Some semantics: • Read the ‘equal to’ sign as “is” or � belongs ... Ω(g(n)) if ∃ n0 , ∃ d s.t ≤ d.g(n) ≤ T (n) ∀n ≥ n0 Substituting for n0 , we have ≤ 4n2 + 22n − 12 ≤ n2 ∀n ≥ ∴ 4n2 + 22n − 12 = Ω(n2 ) Semantics: • Read the ‘equal to’ sign as “is” or � belongs ... from string merge sort rather than insertion sort eliminate sorting altogether Time ? 195 s 84 s 41 s 13 s 6s 1s Asymptotic ? Θ(n2 ) → Θ(n) Θ(n2 ) → Θ(n) Θ(n) → Θ(n) Θ(n2 ) → Θ(n lg(n)) a Θ(n)...
  • 6
  • 494
  • 1
Giới thiệu về các thuật toán - lec3

Giới thiệu về các thuật toán - lec3

Ngày tải lên : 15/11/2012, 10:24
... insert 49 BST 49 insert 79 BST 49 root 79 all elements > 49 off to the right, in right subtree 79 all elements < 49 , go into left subtree 49 insert 46 BST 46 49 insert 41 insert 64 79 46 BST 64 41 ... Example 37 41 now x 46 49 x 56 x time (mins) x Figure 1: Runway Reservation System Example Let R denote the reserved landing times: R = (41 , 46 , 49 , 56) Request for time: 44 not allowed (46 �R) 53 ... next-larger (46 ) return? 49 79 41 46 Figure 4: next-larger(x) What about rank(t)? Cannot solve it efficiently with what we have but can augment the BST structure what lands before 79? 49 43 46 79 64 keep...
  • 6
  • 451
  • 2
Giới thiệu về các thuật toán - lec4

Giới thiệu về các thuật toán - lec4

Ngày tải lên : 15/11/2012, 10:24
... = 29: left-left case Insert(23) 41 65 20 φ 11 41 50 φ 29 φ 11 φ 23 Done Insert(55) 41 41 20 65 20 50 φ 26 φ 11 29 φ φ 23 φ 23 Done 41 φ 23 20 65 26 50 φ 29 φ 41 20 65 1 26 x=65: left-right case ... Fh = √ (rounded to nearest integer) √ 1+ ≈ 1.618 where φ = (golden ratio) =⇒ maxh ≈ logφ (n) ≈ 1 .44 0 lg(n) AVL Insert: insert as in simple BST work your way up tree, restoring AVL property (and ... left and right children of every node to differ by at most ±1 This is illustrated in Fig 4) k-1 k Figure 4: AVL Tree Concept In order to implement an AVL tree, follow two critical steps: • Treat...
  • 9
  • 531
  • 1
Giới thiệu về các thuật toán - lec5

Giới thiệu về các thuật toán - lec5

Ngày tải lên : 15/11/2012, 10:24
... (key, value) pairs e.g d = ‘algorithms’: 5, ‘cool’: 42 d.items() d[‘cool’] d [42 ] ‘cool’ in d 42 in d → → → → → [(‘algorithms’, 5),(‘cool’,5)] 42 KeyError True False Python set is really dict where ... “prehash” • Ideally, x = y ⇔ hash(x) = hash (y) • Python applies some heuristics e.g hash(‘\φB ’) = 64 = hash(‘\φ \ φC’) • Object’s key should not change while in table (else cannot find it anymore) ... Spring 2008 Chaining Linked list of colliding elements in each slot of table U k k k k k1 k1 k4 k2 k3 h(k 1) = h(k 2) = h(k ) Figure 3: Chaining in a Hash Table • Search must go through whole...
  • 7
  • 431
  • 1
Giới thiệu về các thuật toán - lec6

Giới thiệu về các thuật toán - lec6

Ngày tải lên : 15/11/2012, 10:24
... delete • solution: when n decreases to m /4, shrink to half the size =⇒ O(1) amortized cost for both insert and delete - analysis is harder; (see CLRS 17 .4) String Matching Given two strings s and ... and 32.2 Recall: Hashing with Chaining: all possible keys U k k k k m slots Cost : Θ (1+α) k4 k3 Figure 1: Chaining in a Hash Table Multiplication Method: h(k) = [(a · k) mod 2w ] � (w − r)...
  • 6
  • 520
  • 1
Giới thiệu về các thuật toán -lec7

Giới thiệu về các thuật toán -lec7

Ngày tải lên : 15/11/2012, 10:24
... k h(k,1) h(k ,4) h(k,2) Figure 2: Order of Probes Example: Insert k = 49 6 probe h (49 6, φ) = probe h (49 6, 1) = probe h (49 6, 2) = φ m-1 586 , 133 , collision 2 04 , 49 6 , 48 1 , collision ... consecutive group of filled slots grows, gets more likely to grow (see Fig 4) ; ; h(k,m-1) h(k,0) h(k,1) h(k,2) ; ; Figure 4: Primary Clustering • for 0.01 < α < 0.99 say, clusters of Θ(lg n) These ... 6.006 Spring 2008 Delete(k) • can’t just set T [h(k, i)] = None • example: delete(586) =⇒ search (49 6) fails • replace item with DeleteMe, which Insert treats as None but Search doesn’t Probing...
  • 6
  • 496
  • 1
Giới thiệu về các thuật toán - lec8

Giới thiệu về các thuật toán - lec8

Ngày tải lên : 15/11/2012, 10:24
... Example 16 10 9 14 MAX_HEAPIFY (A,2) heap_size[A] = 10 10 16 10 14 10 9 Exchange A[2] with A [4] Call MAX_HEAPIFY(A ,4) because max_heap property is violated 16 10 14 9 Exchange A [4] with A[9] No ... 5 4 i=1 θ(n ) time in-place Figure 3: Selection Sort Example Heaps (Not garbage collected storage) A heap is an array object that is viewed as a nearly complete binary tree 16 9 4 10 14 16 14 ... is an array object that is viewed as a nearly complete binary tree 16 9 4 10 14 16 14 10 Figure 4: Binary Heap Data Structure root A[i] Node with index i i PARENT(i) = � � LEFT(i) = 2i RIGHT(i)...
  • 6
  • 470
  • 1
Giới thiệu về các thuật toán - lec9

Giới thiệu về các thuật toán - lec9

Ngày tải lên : 15/11/2012, 10:24
... A 4 14 16 7 10 MAX-HEAPIFY (A,3) Swap A[3] and A[7] 4 14 3 16 7 10 10 MAX-HEAPIFY (A,2) Swap A[2] and A[5] Swap A[5] and A[10] 4 14 10 16 16 10 14 MAX-HEAPIFY (A,5) no change MAX-HEAPIFY (A ,4) ... 16 10 14 8 10 14 10 heap_size = MAX_HEAPIFY (A,1) 7 10 16 not part of heap Note: cannot run MAX_HEAPIFY with heapsize of 10 1 14 10 7 10 14 10 not part of heap 16 MAX_HEAPIFY (A,1) 1 10 7 4 10 ... MAX-HEAPIFY (A,5) no change MAX-HEAPIFY (A ,4) Swap A [4] and A[8] 10 9 10 14 MAX-HEAPIFY (A,1) Swap A[1] with A[2] Swap A[2] with A [4] Swap A [4] with A[9] 10 16 6.006 Spring 2008 10 Figure 2: Example:...
  • 7
  • 468
  • 1
Giới thiệu về các thuật toán - lec10

Giới thiệu về các thuật toán - lec10

Ngày tải lên : 15/11/2012, 10:24
... with the A[i]’s A: 3 B: 3 0 0 C: C: 2 4 C: 1 Figure 4: Counting Sort Execution A[n] = A[5] = C[3] = B[3] = A[5] = 3, C[3] decr A [4] = C [4] = B[5] = A [4] = 4, C [4] decr and so on 6.006 Spring 2008 ... 2008 Example Sort < a1 , a2 , a3 >=< 9, 4, > Each leaf contains a permutation, i.e., a total ordering 1:2 > (a1 > a2) 1:3 2:3 > (a1 > a3) 2:3 (a2 ≤ a3) ≤ 231 4 6≤ Figure 2: Decision Tree Execution ... Sorting lower bounds – Decision Trees • Linear-Time Sorting – Counting Sort Readings CLRS 8.1-8 .4 Comparison Sorting Insertion sort, merge sort and heap sort are all comparison sorts The best...
  • 5
  • 462
  • 1
Giới thiệu về các thuật toán - lec11

Giới thiệu về các thuật toán - lec11

Ngày tải lên : 15/11/2012, 10:24
... bins appropriately to create a deck! Example 5 3 7 4 5 5 7 9 2 3 5 9 7 3 4 5 7 Digit sort needs to be stable, else will get wrong result! Figure 4: Example of Radix Sort Lecture 11 Sorting IV: Stable ... officially a part of 6.006 • Sorting Races Stable Sorting Preserves input order among equal elements 4 3* 3* 4 counting sort is stable merge sort is stable Figure 1: Stability Selection Sort and Heap:...
  • 5
  • 363
  • 1
Giới thiệu về các thuật toán - lec12.

Giới thiệu về các thuật toán - lec12.

Ngày tải lên : 15/11/2012, 10:24
... diameter 3,6 74, 160 90◦ & 180◦ turns 54 321 1, 847 9,992 50,136 227,536 870,072 1,887, 748 623,800 2, 644 ← diameter 3,6 74, 160 Wikipedia Pocket Cube Cf × × Rubik’s cube: ≈ 1 .4 trillion states; diameter is ... Figure 4: Breadth-First Tree � reachable configurations distance 10 11 12 13 14 90◦ turns 27 120 5 34 2,256 8,969 33,058 1 14, 149 360,508 930,588 1,350,852 782,536 90,280 276 ← diameter 3,6 74, 160 ... factor out 24- fold symmetry of cube: fix one cubelet 811 =⇒ 7!.37 = 11, 022, 48 0 • in fact, graph has connected components of equal size =⇒ only need to search in one =⇒ 7!.36 = 3, 6 74, 160 Lecture...
  • 9
  • 490
  • 0
Giới thiệu về các thuật toán - lec13

Giới thiệu về các thuật toán - lec13

Ngày tải lên : 15/11/2012, 10:24
... Searching II 6.006 Spring 2008 Depth-First Search (DFS): This is like exploring a maze s Figure 4: Depth-First Search Frontier • follow path until you get stuck • backtrack along breadcrumbs until...
  • 6
  • 351
  • 0
Giới thiệu về các thuật toán - lec14

Giới thiệu về các thuật toán - lec14

Ngày tải lên : 15/11/2012, 10:24
... topological sort • intractable problems • P, NP, NP-completeness Readings CLRS, Sections 22 .4 and 34. 1- 34. 3 (at a high level) Recall: • Breadth-First Search (BFS): level by level • Depth-First Search ... Lecture 14 Searching III 6.006 Spring 2008 Lecture 14: Searching III: Toplogical Sort and NP-completeness Lecture Overview: Search ... check) • finding shortest solution: NP-COMPLETE [Ratner & Warmuth 1990] 10 11 12 13 14 15 Figure 3: Puzzle Lecture 14 Searching III 6.006 Spring 2008 Tetris: Given current board configuration & list...
  • 6
  • 345
  • 0
Giới thiệu về các thuật toán - lec15

Giới thiệu về các thuật toán - lec15

Ngày tải lên : 15/11/2012, 10:24
... without negative cycles) Could be exponential time with poor choice of edges v0 v1 v2 v3 v4 v5 v6 10 12 13 14 13 12 11 10 T(n+2) = + 2T(n) v0, v1 v1, v2 v2, T(n) = θ(2 ) v0, v2 v2, T(0) = n/2 10 ... = NIL initially Lecture 15 Shortest Paths I: Intro 6.006 Spring 2008 Example: A 1 S 2 E 3 C 3 1 4 D B F Figure 1: Shortest Path Example: Bold edges give predecessor Π relationships Negative-Weight ... Weighted Graphs • General Approach • Negative Edges • Optimal Substructure Readings CLRS, Sections 24 (Intro) Motivation: Shortest way to drive from A to B (Google maps “get directions”) Formulation:...
  • 7
  • 367
  • 0
Giới thiệu về các thuật toán - lec16.

Giới thiệu về các thuật toán - lec16.

Ngày tải lên : 15/11/2012, 10:24
... 1 -1 -2 d[u] -1 -4 etc v Figure 2: Algorithm may not terminate due to negative Cycles Complexity could be exponential time with poor choice of edges v0 T(n) = θ(2 ) n/2 v2 v3 v4 v5 v6 T(n) = + ... d[v] = δ(s, v), if no negative-weight cycles -1 ∞ -1 B -1 4 2 3 E C ∞ B -1 A ∞ -3 E D C ∞ End of pass A D ∞ ∞ 1 -3 -2 End of pass (and and 4) Figure 5: The numbers in circles indicate the order ... C3) if C2 > 1, trouble! Divide & Explode C2 > okay provided C3 > if C3 > Divide & Conquer Figure 4: Exponential vs Polynomial Bellman-Ford(G,W,S) Initialize () for i = to | v | −1 for each edge...
  • 5
  • 263
  • 0
Giới thiệu về các thuật toán - lec17

Giới thiệu về các thuật toán - lec17

Ngày tải lên : 15/11/2012, 10:24
... Shortest paths in graphs without negative edges • Dijkstra’s Algorithm Readings CLRS, Sections 24. 2- 24. 3 DAGs: Can’t have negative cycles because there are no cycles! Topologically sort the DAG...
  • 5
  • 303
  • 0