Introduction to Data Structure with real life examples
Gate Smashers will discuss what data structure is, its use and where do we see or use it in
the real life. Big companies like Google and Amazon are collecting data in a large amount on
a daily basis. Since the data is being collected there will be some organization and
management for it and we will also have to give a storage format to it. This is known as Data
Structure. Data Structure is neither a software nor a data type like integer or float. Data
structure is simply a way to store the data. The data structure is the base for everything
including your application, software, and website. If they are working well, It means that
there is a data structure behind it which is its base. For instance, when you search for
something on Google, thousands of users are searching simultaneously , and you still get
the results with the same speed. When you buy any product on amazon, you enter a book
Data structure you immediately get the reviews. There is stack , queue , and array.
Naina will discuss a simple and widely used data structure, that is Array. This is used in
high-level languages like C, C++ and Java. The array is also used for implementing data
structures like stack and queue. So quickly like the video and subscribe to the channel. The
number of participants is fixed and the type is either male or female. In C and C++, an array
is always started with 0. But since I am giving you a general example , I have started it from
1. I have drawn the 5 locations of the array inside the memory here. We will not give different
names to different elements. A unique name will be given to every element but its position
will be determined by its index number. This is the memory of 5 elements which is
contiguous. This was all about the elements in the memory , how we can access them.
There is a defined position for each element and they use contiguous memory. To find the
total number of elements or the size of the array, the formula will be UB-LB+1. The upper
bound is 5, minus lower bound , which is 1, plus 1.
You can take anything here. I used a general array and explained you by starting from 1.
This was the introduction part of array. We will discuss arrays in more detail in the upcoming
videos. Thank you for your feedback on how to use array in the next video.
Types of Array | One dimensional & Multi-dimensional
Array
There are two types of array. The first is One-dimensional array and the other is
Multidimensional array. In one dimensional array, we use a single dimension to access the
data. When there are multiple dimensions, it is known as multidimensional. In multi-
dimensional arrays, we will increase the dimensions. In the 2d array, there will be a
dimension for the rows and another for the number of columns. There will be three rows and
four columns. The number of arrays is 2. The rows in those arrays will be 3 rows and the
columns will be 4. The total number of elements will be 12. The base address will be. . . look
here. This is 0 , and this is 1. 0 links the first array and 1 links the second array. This is not
the memory representation. This matrics form is not that. All the 2d or 3d arrays are stored
as 1d arrays in the memory. We just see it this way because we are representing it in front of
you in this way. In the next video we will study how to give them addresses and how to find a
particular element.
Addressing in One Dimensional Array | Data Structure
, Naina explains how to calculate the address of any element in single dimensional array. She
says that random access means that we access the array randomly. To find the address, we
must know the base address. We started its base address from 3000. The address of the
first element is 3000. Plus, how many elements we have crossed ? How many elements do
we need to cross here ? I will have to cross 2 elements. Where did we start the index ? From
0. The data structure is not dependent on any language. If we start from 1 and we need to
find the location of A [ 2 ] , how can we do so ? The base address of it is 3000. Plus, How
many elements do we. need to cross 1 element. We will write ' 1 ' here. What will be the value
of A. 3 element A [ 3 ] ? It will be 3006. We found this location as 3002 and we found the
value. You have to solve the questions given on the screen and tell the answer by
commenting. If you are unable to solve it, I will explain it in the next video. The array will be
formed this way: -3 is the lower bound and 4 is the upper bound. From -3. . . -3 , -2 , -1 0 , 1 0,
1 , 2 , 3 , and 4 will form this way.
Linear Search in Data Structure | Time Complexity
Gate Smashers explains linear search/sequential search. The method for linear search is
very simple because in this we have to move in a sequential form. Only. WE have to keep
searching in the same form in which the elements are stored.. IF. The element matches the
first element of the array, we will stop searching because we found the element. IF we still
do n't find the element. It means that we could not find any element and the search will be
unsuccessful.. There is a sequence of the algorithm. SO. We have written every step in a
sequence about how will it work. Look here., A stands for array from which have to find the
item. Then. The item that we need to search for. 22 and 95 were the items. WE have given
three things on the list.. WE will have to give an array because we have. to search in that
only. THe index of the location where we will find it will be returned. There will be two
conditions. First, we have to reach this value. Then we will again jump to the next with an
increment of 1. THis way, we must reach the end of the array.. We have put the second
condition by using logic and operator. IT is to verify whether the A [ i ] or the element to
which we have reached is equivalent to our item or not..
There are three cases, the best case, the worst case, and the average case. IF. We keep
incrementing the value of I, but still do n't find the value, it will directly get out of the loop and
check whether it matches or not. IF it does n't, it will return [UNK] That means that we did n't
get the item. This was the algorithm for linear search.
Introduction to Linked List | Types and Need of linked list |
data structures
Linked list is a linear data structure that includes a series of connected nodes. each node
store the data and the address of the next node. As soon as it will get the address from this
node, it will directly jump to that node.. linked list overcomes the disadvantage of array. the
linked list works. This way. this node may exist at any location of the memory., but the
address will only be in the linked part. the address of this will be stored in the link part of the
previous node.. If the address is matched, they will be linked together. if we give the address
of the third node to the address. Part of this and they will also get linked.. There are three
types of linkedNK] single linked lists, double linked lists and circular linked lists. we will
discuss each of them one by one and. and study its algos. for now, just learn what a single
Gate Smashers will discuss what data structure is, its use and where do we see or use it in
the real life. Big companies like Google and Amazon are collecting data in a large amount on
a daily basis. Since the data is being collected there will be some organization and
management for it and we will also have to give a storage format to it. This is known as Data
Structure. Data Structure is neither a software nor a data type like integer or float. Data
structure is simply a way to store the data. The data structure is the base for everything
including your application, software, and website. If they are working well, It means that
there is a data structure behind it which is its base. For instance, when you search for
something on Google, thousands of users are searching simultaneously , and you still get
the results with the same speed. When you buy any product on amazon, you enter a book
Data structure you immediately get the reviews. There is stack , queue , and array.
Naina will discuss a simple and widely used data structure, that is Array. This is used in
high-level languages like C, C++ and Java. The array is also used for implementing data
structures like stack and queue. So quickly like the video and subscribe to the channel. The
number of participants is fixed and the type is either male or female. In C and C++, an array
is always started with 0. But since I am giving you a general example , I have started it from
1. I have drawn the 5 locations of the array inside the memory here. We will not give different
names to different elements. A unique name will be given to every element but its position
will be determined by its index number. This is the memory of 5 elements which is
contiguous. This was all about the elements in the memory , how we can access them.
There is a defined position for each element and they use contiguous memory. To find the
total number of elements or the size of the array, the formula will be UB-LB+1. The upper
bound is 5, minus lower bound , which is 1, plus 1.
You can take anything here. I used a general array and explained you by starting from 1.
This was the introduction part of array. We will discuss arrays in more detail in the upcoming
videos. Thank you for your feedback on how to use array in the next video.
Types of Array | One dimensional & Multi-dimensional
Array
There are two types of array. The first is One-dimensional array and the other is
Multidimensional array. In one dimensional array, we use a single dimension to access the
data. When there are multiple dimensions, it is known as multidimensional. In multi-
dimensional arrays, we will increase the dimensions. In the 2d array, there will be a
dimension for the rows and another for the number of columns. There will be three rows and
four columns. The number of arrays is 2. The rows in those arrays will be 3 rows and the
columns will be 4. The total number of elements will be 12. The base address will be. . . look
here. This is 0 , and this is 1. 0 links the first array and 1 links the second array. This is not
the memory representation. This matrics form is not that. All the 2d or 3d arrays are stored
as 1d arrays in the memory. We just see it this way because we are representing it in front of
you in this way. In the next video we will study how to give them addresses and how to find a
particular element.
Addressing in One Dimensional Array | Data Structure
, Naina explains how to calculate the address of any element in single dimensional array. She
says that random access means that we access the array randomly. To find the address, we
must know the base address. We started its base address from 3000. The address of the
first element is 3000. Plus, how many elements we have crossed ? How many elements do
we need to cross here ? I will have to cross 2 elements. Where did we start the index ? From
0. The data structure is not dependent on any language. If we start from 1 and we need to
find the location of A [ 2 ] , how can we do so ? The base address of it is 3000. Plus, How
many elements do we. need to cross 1 element. We will write ' 1 ' here. What will be the value
of A. 3 element A [ 3 ] ? It will be 3006. We found this location as 3002 and we found the
value. You have to solve the questions given on the screen and tell the answer by
commenting. If you are unable to solve it, I will explain it in the next video. The array will be
formed this way: -3 is the lower bound and 4 is the upper bound. From -3. . . -3 , -2 , -1 0 , 1 0,
1 , 2 , 3 , and 4 will form this way.
Linear Search in Data Structure | Time Complexity
Gate Smashers explains linear search/sequential search. The method for linear search is
very simple because in this we have to move in a sequential form. Only. WE have to keep
searching in the same form in which the elements are stored.. IF. The element matches the
first element of the array, we will stop searching because we found the element. IF we still
do n't find the element. It means that we could not find any element and the search will be
unsuccessful.. There is a sequence of the algorithm. SO. We have written every step in a
sequence about how will it work. Look here., A stands for array from which have to find the
item. Then. The item that we need to search for. 22 and 95 were the items. WE have given
three things on the list.. WE will have to give an array because we have. to search in that
only. THe index of the location where we will find it will be returned. There will be two
conditions. First, we have to reach this value. Then we will again jump to the next with an
increment of 1. THis way, we must reach the end of the array.. We have put the second
condition by using logic and operator. IT is to verify whether the A [ i ] or the element to
which we have reached is equivalent to our item or not..
There are three cases, the best case, the worst case, and the average case. IF. We keep
incrementing the value of I, but still do n't find the value, it will directly get out of the loop and
check whether it matches or not. IF it does n't, it will return [UNK] That means that we did n't
get the item. This was the algorithm for linear search.
Introduction to Linked List | Types and Need of linked list |
data structures
Linked list is a linear data structure that includes a series of connected nodes. each node
store the data and the address of the next node. As soon as it will get the address from this
node, it will directly jump to that node.. linked list overcomes the disadvantage of array. the
linked list works. This way. this node may exist at any location of the memory., but the
address will only be in the linked part. the address of this will be stored in the link part of the
previous node.. If the address is matched, they will be linked together. if we give the address
of the third node to the address. Part of this and they will also get linked.. There are three
types of linkedNK] single linked lists, double linked lists and circular linked lists. we will
discuss each of them one by one and. and study its algos. for now, just learn what a single