Data Types
2 Arithmetic funtions ans laws
3 The Associative Law
4 The Identity Law
5 The Inverse Law
6 The Commutative Law
7 Data Types Algebras such as groups, rings, etc. are familiar data types in mathematics. CS handles other data types other than those algebras. –stacks –queues –arrays –binary trees –other useful data structures A data type consists of various sets of data together with operations between them definable in a distributive category and equations expressible in a distributive category.
8 Stacks (Rough View)
9 Pop revised to avoid stack underflow
10 Push revised for symmetry
11 Axioms
12 Definition.
13 Ex. 1. Infinite stacks
14 Note Just from the axioms, we do not know whether the stacks are finite.
15 Definition. Stacks of X
16 Ex. 2.
17 Notation
18 Ex. 3. The usual operation of pushing an element on a stack
19 Ex. 4. Imperative computing of the depth of a stack
20 Ex. 5. Tests on stacks
21 Arrays - the store function
22 Arrays - the read function
23 Binary Trees
24 Two operations make and break
25 Def. Binary Tree
26 Queues
27 Pointers
28 Turing Machines