1/9
Looks like no tags are added yet.
What is Data structure
Structuring our data inside of RAM
RAM
RAM is measured in bytes
Byte = 8 Bits
A bit can be thought of as position that can store a digit
A digit can be either 0 or 1
A simple digit (like natural numbers) takes 4 bytes
Giga → 109
RAM components
RAM is made of:
Values
Addresses
Every value is stored at a distinct location
Arrays
Arrays store characters the same way as numbers but each character takes only 1 byte to store in memory

Any data structure the two most common operations
Reading to the data
writing to the data
Reading the data (from an array)
"Reading from an array" refers to accessing and retrieving elements stored within an array data structure in a programming language.
Arrays are containers that store a collection of elements, and reading from an array involves retrieving specific elements or iterating through all elements in the array.
Writing to an array (static array)
Arrays are fixed-size.
Static arrays mean that they are fixed-size arrays.
In most programming languages, static arrays have a fixed size that cannot be changed once they are initialized.
Therefore, directly removing the last element from a static array is typically not supported. Instead, you'd usually overwrite the value in the last position or adjust the logic to work within the bounds of the array size.
let arr = [1,2,3]
arr[arr.length - 1] = null // Overwriting the last element with nullO(n)
O means → In the worst case.
n → refers to a variable.
i-th
i-th means → any arbitrary element you could pick, any index
Summary of static array
r/w i-th element → O(1). you could do it in constant time
Insert/Remove End → O(1)
Insert Middle → O(n)
Remove Middle → O(n)