Please enable JavaScript.
Coggle requires JavaScript to display documents.
Data Structures (01- Simple data & Arrays (Arrays (specific datatype…
Data Structures
01- Simple data & Arrays
Def: Arrangement of data together in memory. Ordered/un-ordered, it depends
Examples: Bank statement, recipe, file cabinet etc
Simple data structures
Numbers, Strings, Booleans
Struct
-
Struct vs Class
only data, no behaviors
simple creation, no instances
value types
no OOPs features
PODs
Simple objects like Point, Color etc
Arrays
-
-
-
-
-
-
these rules of fix size and datatype makes memory management easy as its simple to create, rather having everything dynamic
Multidimensional Arrays
metrics, table, rows n columns
examples: chess board, daily temperature (day-hour)
-
Advanced Array behaviors
Resizable Arrays
-
-
Adding element at start or end will be an easy task, but not in between
-
-
-
05- Sets, Trees & Graphs
Sets
-
no index, key or sequence
-
fast lookup to check only existence, not retrieval
Tree
collection of nodes, having one or more children in a hierarchy
terminology: root node, child nodes, siblings
-
-
-
Graphs
-
terminology: vertices, edges, directed/undirected graphs
-
02- Lists
LinkedList
no direct access, iterate and get items
-
-
Objects can be stored anywhere, no sequential data
-
-