Lower triangular matrix 我们以矩阵的下三角部分为例,来分析矩阵元素a,;对应的 存储空间的地址。在下三角部分,第k行有个元素,而a,元 素之前共有i-1行,再加上第行的个元素,所以啡在下 三角部分的位序( index)是: ∑(k+1)+j=1+2+…+1+j=2+j
Lower triangular matrix 我们以矩阵的下三角部分为例,来分析矩阵元素 对应的 存储空间的地址。在下三角部分,第k行有k个元素,而 元 素之前共有 i-1 行,再加上第i行的j个元素,所以 排在下 三角部分的位序(index) 是:
2. Jagged Table with Access Table Jagged array 4 14 Access 14 array 16 23 24 29 Fig 9.5 pg 385
2. Jagged Table with Access Table Fig 9.5 pg.385
3. Inverted Table Name Address Phone 1 Hill, Thomas M High Towers #317 2829478 2 Baker. John S 17m treet 2884285 3 Roberts. L B 53 Ash street 4372296 4 King, Barbara High Towers #802 2o0 5 Hill. Thomas m. 39 King street 2495723 6 Byers, Carolyn 118 Maple Street 4394231 倒排表 7 Moody, C L High Towers #210 2822214 Access tables ame Address Phone 2615473 4256 4236 Fig 9.6 pg 387
3. Inverted Table Fig 9.6 pg.387 倒排表
9.4 Tables: A New Abstract Data Tye// 1 Functions Domain (Index set) Codomain (Base type In mathematics a function is defined in terms of two sets and a correspondence from elements of the first set to elements of the second. If f is a function from a set a to a set B, then f assigns to each element of aa unique element of B. The set a is called the domain of f, and the set b is called the codomain of f
◆ In mathematics a function is defined in terms of two sets and a correspondence from elements of the first set to elements of the second. If f is a function from a set A to a set B, then f assigns to each element of A a unique element of B. ◆The set A is called the domain of f , and the set B is called the codomain of f . 9.4 Tables: A New Abstract Data Type 1 Functions
The subset of B containing just those elements that occur as values of f is called the range of f DEFINITION A table with index set and base type Tis a function from /to T together with the following operations 1. Table access: Evaluate the function at any index in 2. Table assignment: Modify the function by changing its value at a specified index in / to the new value specified in the assignment 3. Creation: Set up a new function 4. Clearing: Remove all elements from the index set /,so there is no remaining domain. 5. Insertion: Adjoin a new element x to the index set / and define a corresponding value of the function at X 6. Deletion: Delete an element x from the index set and restrict the function to the resulting smaller domain
◆The subset of B containing just those elements that occur as values of f is called the range of f . DEFINITION A table with index set I and base type T is a function from I to T together with the following operations. 1. Table access: Evaluate the function at any index in I . 2. Table assignment: Modify the function by changing its value at a specified index in I to the new value specified in the assignment. 3. Creation: Set up a new function. 4. Clearing: Remove all elements from the index set I , so there is no remaining domain. 5. Insertion: Adjoin a new element x to the index set I and define a corresponding value of the function at x. 6. Deletion: Delete an element x from the index set I and restrict the function to the resulting smaller domain