Explore Data Structure and Algorithm Part-2
Before starting, the second part make sure you read the part-1: https://m-alinkon10.medium.com/explore-data-structure-and-algorithm-part-1-89f0059dedfc
Hello readers, Today we are gonna cover the DSA part-2. Part-2 basically contains those part
B: Data Structure
B1: Classification of DS
B2: Non-primitive Data type
B2.1: Array
B2.2: LinkedList
B2.3:Trees
B2.4: Trees have more diversion
B2.4.1: Stack.
B2.4.2: Queue
and finally
B2.4.3: Graph
We all know about DS. I talked about it in Part-1.
So, What is the Classification Of DS
DS => 1.Primitive 2.Non- Primitive
1. Primitive => 1.1: Integer (0,1,2,3,) & 1.2: Real (0.1,0.3) & 1.3: Character (A,a,B,b,C,c,#) and finally 1.4: Boolean (true/false);
In Data Structure we don’t have to know primitive DS all works are in Non-Primitive
2. Non-Primitive are Array, LinkedList, Trees

B2.1: Array: Array is a data structure which is contained the element. Which is accessible by index and it starts from 0. Example: int arr[5] = {1,2,3,4,5}
Here we are gonna discuss 1D(dimensional) Array and 2D Array.
This example said that it is a 1D array with the accessible index and we know that the array index starts from 0. So if we want to access 3 we have to write like that
arr[2] = 3. So we can access an element by index.
Let’s discuss the 2D array. 2D array basically works with Coordinates. X and Y
Example : arr[2][5] = {{1,2,3,4,5},{6,7,8,9,10}}
2 Consider as a row and 5 consider as a column.
arr[0] = 1–2–3–4–5
arr[1]= 6–7–8–9–10
If you want to access 8 you have to access like that “arrayName[row][index]”
arr[1][2] = 8 //See you can access element by row and column index.
Note: There is a more complex array structure are there if you want to learn more things we can search on google.

B2.2: LinkedList
B2.2: LinkedList: In simple words, a linked list consists of nodes where each node contains a data field and a reference(link) to the next node in the list.
**Singly Linked List
**Circular Linked List
**Doubly Linked List
Let’s see an example: Imagine there is one shop which customer will buy a product and the product will refer to the selles man and whenever manager whats to know how many product one sells man sell, after a day it needs to be shown.
For this problem, we can use the LinkedList data structure.
— — — — — -Table 1 — — — —
SN — Customer Name— -Product Name — Selles Man name
1 — Andy — — — — — —TV — — — — — — Jhon
2 — Bandy — — — — — ..Fridge — — — — Jhon
3 — Candy — — — — — -.TV — — — — — — Smith
4 — Dandy — — — — — .FAN — — — — — -Ray
5 — Endy — — — — — ..Phone — — — — -Smith
— — — — Table2 — — — — — — -
SN — Sells Man
1 — -Jhon
2 — Smith
3 — Ray
so LinkedList work as => Head → Body → Tail
Head is starting from of node → and the body which is contain the information → and tail is ending point of information or refering form
Step 1 :
Add a pointer of Table-1
Note: Pointer will be SN of Selles man
— — — — — -Table 3— — — —
SN — Customer Name — -Pointer — Selles Man name
1 — Andy — — — — — — 1 — — — — — — Jhon
2 — Bandy — — — — —..1 — — — — — — Jhon
3 — Candy — — — — — -.2— — — — — — Smith
4 — Dandy — — — — — ..3— — — — — — Ray
5 — Endy — — — — — …2 — — — — — — Smith
Step 2:
It is important to part of Store data in the link list
There also needs a pointer but this time customer SN will the be a pointer
— — — — Table4 — — — — — — -
SN — Sells Man —Pointer
1 — -Jhon — — — ..1,2
2 — Smith — — — .3,5
3 — Ray — — —….4
Link will define as a tail of the node —
Which node it is refer to it will contain the address
SN — Customer Name — -Link— — — — -
1 — Andy — — — — — — 2 — — — — — — tail is 2 meas connection with SN2
2 — Bandy — — — —……0— — — — — — tail is 0 means there is no connection
3 — Candy — — — — — -.5 — — — — — — tail is 5meas connection with SN5
4 — Dandy — — — — — ..0 — — — — — — tail is 0 means there is no connection
5 — Endy — — — — — …0 — — — — — — tail is 0 means there is no connection

So the link list works like that. Hope it is understood if you didn’t understand anything Please comment I will try to explain more in the comment section
Thank you