click the bell icon to get latest videos
from Ekeeda Hello friends in this video
we will be discussing about what is
array what is use of array and the
algorithm which we use to tan inverse an
 now what is array array you can say
is a collection of what date items and
all your data items should be of what
same time for an example suppose if I
taken one variable called as A and I
wrote A is equal to 1 after some times
if I will make it as a is equal to 2 a
is equal to 3 a is equal to 4 and after
all this suppose at the end of the
everything I print value of C what will
be my answer obviously my value of a is
going to be 1/4 it means what at a time
you can store only one value in a
variable so initially I had assigned one
value to variable a which was got
replaced by 2 then it got replaced by 3
and then it got replaced by 4 so every
variable can hold only one value at a
time now what to do suppose in the
program if I need to build with the n
variables or 10 different values then to
deal with it in different values I have
to declare 10 valuable every time it is
not possible to declare 10 variables or
more than 10 variables in a program it
would be very difficult for us also to
remember the variable names in that case
so in that case what I will be doing I
will take on a single variable which is
capable of holding more than one value
into it
and that variable is nothing but what
your so any variable can hold more than
what they are using to it at a time so
you can say array is a collection of
values of same data-type same data type
means the values which we are storing
into the single variable that should
belong to us say data time if I declare
my array as a integer array then all the
values which I will be storing inside
the array that should be of integer type
if I declare it as a float then all the
values should be or for flow type
decimal values the integer values won't
be allowed in that and so the definition
of arrays arrays a list of finite number
of homogeneous data element homogeneous
data element means nothing but for yet
all the elements should be of what same
time the element of array are stored in
successive memory location
suppose if my first element I have
stored at thousand then obviously my
next element will be getting store at
thousand and one my next tournament will
be getting store at thousand and two
thousand and three and so on so in the
array we store the element in such a way
that my all element should get store one
after the other or you can say they
should get stored in consecutive memory
location every element of array is
referred by its index number for an
example see suppose if this is array in
this array I have stored total eight
elements called as a b c d e f g h now
every element will be referred by its
index number so this is 0 1 2 3 r
Condors what index so it means i have
stored element a at a of 0 so my a of 0
is nothing but what a my a of 1 is equal
to p my a of 2 is equal to c and so on
and at the end my a of 7 will be h so in
this way we store a element in our array
now number of element of the array is
called as length of the array and it can
be calculated by using formula length is
equal to UB minus lb plus 1 where you
base called as upper pass L base called
as lower bound and plus 1 your upper
bound is me it means your upper limit of
an array which is 7 here and lower bound
is lower limit of an array which is 0 so
7 minus 0 plus 1 is going to be a 8 so
the length of this array is 8
it means
this array is having total 8 elements
into it and every element is referred by
its index number 0 to 7 they are called
as what index number and all the
elements will get stored one after the
other that is they will get stored in
consecutive memory location now the next
thing which we have to studies
algorithms at the beginning of this
chapter we have studied various types of
data structure operation there are total
six types of data structure operation
traversing some chain
merging sorting inserting and deleting
so for every data structure operation we
have some algorithm in the in this first
we will start with the traversing and
adding see the algorithm
suppose if L a is a linear array with
lower bound L will be an upper bound you
B so let us draw an array suppose if
this is array where I have total five
elements into it 0 1 2 3 4 so 0 is
nothing but what might lower bound and 4
is what might appear come now in this
particular array I will be applying
traversing operation how to do that that
we will see with the help of algorithm
now suppose in this array I have the
elements called as a b c b e now I will
be performing traversing operation on
this what is mean by traversing
traversing is accessing element of an
array only once so that you can proceed
so why you will access the element you
will access the element either to read
the element or to write into the admin
so how to do that initialize a counter
set K is equal to lb so my counter is lb
and here lb means lower bound is nothing
but 0 so my kicker value is going to be
what 0 now repeat steps 3 & 4 but in my
K is less than equal to upper bound what
is upper bound here my 4 is upper
so I will be repeating these steps till
my K is less than equal to four
visit element apply process to la of K I
will be visiting the element la of a now
it will be alias k k the case value is
zero so la of zero is going to be your a
I will be an applying process on to a
and then I will increment my counter so
my counter will be k is equal to k plus
1 so at the next iteration my value will
become a layoff 1 which is B so again I
will be applying some process on B and
again I will be incrementing my value of
K by 1 second iteration it will become
Lu of to la of 2 is nothing but what my
C so again I will be applying some
process on to see and I will increment
my counter I will be keep on
incrementing my counter till my counter
curve al U is less than equal to 4 after
Swift after forth I think iteration my
click on and you will become my K curve
and you will become 4 and my this
condition will get satisfied so once
your cake R value is less than equal to
4 you will come out of the loop this is
how we apply process on to the array by
using traversing I will go either thanks
for watching the video in the next video
we will be discussing about the next
data structure operation inserting and
deleting and we will be discussing the
algorithms on inserting and deleting
thank you
