网站大量收购独家精品文档,联系QQ:2885784924

资料型态(Data.ppt

  1. 1、本文档共39页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
资料型态(Data

資料型態(Data Type)-程式語言的變數所能表 示的資料種類 *基本型態(Primitive Type): integer, real, boolean, character(byte) *結構化型態(Structured Type): string, array, record/structure int i, j; char c; float r; int i1[10], j1[10]; float r1[10]; i1[0]=20; i2[1]=90; … 串列(List) *有序串列可以是空的()或寫成(a1, a2, ..., an) 串列的表示法(representation of lists) *順序對應(Sequential mapping)-array *鏈結串列(Linked list)-pointer 堆疊與佇列(Stacks Queues) *堆疊是一個有序串列,所有的insertion和 deletion動作均在頂端(top)進行 *具有後進先出(LIFO-last in first out)特性 *佇列是一個有序串列,所有的insertion和 deletion是發生在串列的不同端,加入的一端 稱為尾端(rear),刪除的一端稱為前端(front) *具有先進先出(FIFO-first in first out)特性 Representation of a stack: *a one-dimensional array: stack[0:n-1] *a variable: top *linked list *node: data, link *a variable: top Representation of a queue: *a one-dimensional array: q[0:n-1] *two variables: front rear *linked list *node: data, link * two variables: front rear Trees *A tree is a finite set of one or more nodes *樹是一個或多個節點(node)所組成的有限集合 *有一個特殊的節點稱為樹根(root) *每一個節點底下有零個或一個以上的子樹 (subtree): T1, T2, …, Tn n?0 *節點(node) *分支(branch, edge) *樹根(root) *子點(children) *父點(parent) *終端節點(leaf, terminal nodes) Trees *非終端節點(nonterminal nodes) *兄弟(siblings) *祖先(ancestor of a node): all the nodes along the path from the root to that node *分支度(degree): the number of subtrees of a node *樹的分支度(degree of a tree): the maximum degree of the nodes in the tree *階度(level): initially let the root be at level one Trees *高度(height, depth): the maximum level of any node in the tree *A forest is a set of n?0 disjoint trees *若一樹有n個nodes,則必有且唯有n-1個 edges *A graph without a cycle Representation of a Tree: *linked list *node: data, link, tag *when tag=1, data field contains a pointer to a list rather than a data item Binary Trees : *Any node can have at most two children *二元樹上每個節點的degree?2 *左子樹(left subtree) 右子樹(right subtree

文档评论(0)

f8r9t5c + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

版权声明书
用户编号:8000054077000003

1亿VIP精品文档

相关文档