📚 C
Lecture-03
PDF 格式
開放完整下載
書籍內容簡介
Lesson 3: More on ADTs using simple examples, eg Stacks, Queues Summary of Lecture: Examples of abstract data-types Why are they required? The Stack as an Abstract Data Type The representation of a stack as an abstract data type is straightforward. We use eltype to denote the type of the stack element and parameterize the stack type with eltype. abstract typedef > STACK (eltype); abstract empty(s) STACK (eltype) s; postcondition empty = = (len(s) = = 0); abstract eltype pop(s) STACK (e1type) s;…