Linear and Non-Linear Data Type
β Linear Data Type
- output if proportional to input
- system follows principle of superpostiion
- (adding input = adding outputs)
- predictable
- linear equations
- Additivity:
- two jobs then add two results π° add two jobs and get one result
- Homogeneity:
- all elements are the same type
- make instuction bigger/smaller β‘οΈ result is also bigger/smaller
array
: has additivitylist
: has additivityqueue
: order is important in insertion, deletion β‘οΈ has homogeneitystack
: order is important in insertion, deletion β‘οΈ has homogeneity
β Non-Linear Data Type
- output is not directly proportional to input
- do not follow principle of superposition
- unpredictable
Binary Search Tree
- non linear bc
path
taken to find/insert/deletedepends on node value
- path depends on
comparision
- non linear bc
Graph
- no strict order of travel
- flow depends on
edges and nodes
This post is licensed under CC BY 4.0 by the author.