01. Data Structures & Algorithm
This is a short article on self re-introduction to Data Structures! I am hoping that this as a kind of note making. Hopefully this might help me for future reference like in my college days.
Define: Data structure is storage of data so that it can be accessed efficiently. Data could be organized in a specific manner so that it can be accessed in most performant manner for processing or usage.
Arrays
Arrays is a very commonly used data structure. Arrays help store same kind of data in continuous memory locations. Arrays are not usually dynamic. Size need to be defined upfront. But languages like Java allocates memory as and when items are added into the array so that it seems to be dynamic.
int[] numArray = new int[10];val numArray: Array<Int> = Array(10){1}Algorithm
Algorithm is a how a set of instructions are written to process any given input so that we are able to solve a problem.
Get Reluctant Starter’s stories in your inbox
Join Medium for free to get updates from this writer.
There are certain set of algorithms that are able to solve definite patterns of problems. Any computing problems can be solved using an algorithm from this set. Examples include: Breadth First Search, Depth First Search, Binary Search etc. Challenge for a programmer is to identify and classify the problem in front of us. And then arrive at what algorithm has to be applied.
Complexity
Complexity is a measure of efficiency of the code we have written to solve the problem.
Time complexity gives an indication towards how much time this code takes to execute. This is NOT an absolute measurement in ‘Seconds’.
Space complexity gives an approximation on how much additional memory is required for a given code to execute.
Asymptotic Analysis
This is used to measure the complexities. The idea is how does the Time requirement and space requirement when the input ’n’ approaches infinity or very large numbers
‘Big O’ notation is used to represent the complexity measurement
Eg: O(n), O(n²), n log n
O(n) is read as “Order of N”
To be continued…








