121 Week 8 - Stack and Linked Lists
暂无描述。系统推荐的高质量记忆内容,适合每天坚持背诵学习。
卡片预览 (8 张)
Stack
An abstract data type which holds a collection of items in the order in which they were added. It is a Last in First out data type meaning items are added to and removed from the top of the stack.
Stack functions
Push - add an item to the top of the stack pop - remove the item on top of the stack and return its value. Empty - return true if the stack has no items, else return false
Underflow
Trying to pop from an empty stack
Overflow
In bounded stacks, trying to push an item when the stack is full
Applications of a stack
Call stack for program execution Syntax and semantics of programming languages Depth first searching algorithms
List
An abstract data type that stores a set of items in a linear order. It cannot have duplicates
Singly linked list
A list where elements contain a value and a pointer to the next item in the list
Doubly linked list
A list where elements contain a value and a pointer to the next item in the list and previous item in the list.