# π Crack Programming Interviews π¨βπ»π©βπ» by understanding Data Structures & Algorithms

hello everyone welcome to this video

series where I am not only gonna help you in your programming interviews but

will also help you in understanding the programming concepts in general so

today’s topic is data structures and algorithms you know this is one of my

favorite topic because every programmer must have answered this particular

question in his or her life at least once whether they are writing a exam

or giving some programming interviews this is one question which everyone has

to answer the understanding of data structures an algorithm is extremely

important for someone to understand the broader meaning of software engineering

and software development in general so let’s go ahead and understand what is

meant by data structures and algorithms now data structures an algorithm are two

different words let’s first talk about data structures now when we talk about

data structures people think that data structures exists only in computer

science for software development no that is incorrect data structure is all

around us let me give you an example so I am having this particular wallet and

which is having a Citibank card in it this is the only content of this

particular wallet so if I want to do some expense or withdraw some cash I

will take this card out I will put it back right now I have another wallet

with me which is having multiple cards in it you can see some Visa and

MasterCard in it and I also have some cash in it okay you know what

I have arranged the cards and cash in such a way so that it’s easy for me to

find out if I want to pick up a card or a cash for example if I want to pick up

a MasterCard it’s easy for me to check which is MasterCard if I want to pick up

bigger denomination notes I have kept it on the right side my right side and

lower denomination notes on the left side and I can take this card do some

shopping and just put it back like this okay and it is actually arranged this

arrangement in this particular wallet is nothing

but a data structure yes you have heard it right your closet at your house or in

your room is a data structure the way you arrange things in your room is a

data structure data structure is all around us now something more when i

have a single card in a particular wallet I don’t need an arrangement because that’s the only content in this particular card I can keep it here I can

keep it here I can keep it here it doesn’t matter because there is only one

thing that is there in this particular wallet okay but as soon as you have

multiple things in your wallet you need to arrange it in a particular way

otherwise you will end up searching each and every place to find your desired

card or cash correct and that’s the reason data structures comes into

picture when you have more than one thing to tackle

you know what when you write int I float f char c they are not called as data

structures but as soon as you convert these into an array or linked list they

are called data structures because they deal with multiple items and whenever

you are having multiple items you need some arrangements so that you can

extract things from the whatever store you have and put things back in it for

example in this particular case in this particular wallet if I get some cash

I’ll put it here if I get a card I will put it here right so this is what data

structure is so data structure is nothing but an agreed arrangement to

efficiently store and retrieve the desired data I’ll repeat it for your

data structure is nothing but an agreed arrangement where it is efficiently

possible to store and retrieve the data or desired data right and that’s why we

need data structures for example in your house if you don’t have data structure

you have to search each and everything to find desired item for example if you

want to take water you go to kitchen because that’s the way arrangement is

there okay otherwise you will go to each and every room to search for water

you know this is the place in my closet where I keep my office going cloths so

you go there and find it out this is the place where I keep my pen this is the

place where I keep my laptop and this is the place where I keep my car key

all those arrangements are data structure because as soon as you have

more than one thing you have to arrange it in a way and that is what data

structure is all about got it what are data structures data structures are all

around us okay so when you are having traffic management more than one thing

data structure we are having a student management data structure whenever you

have more than one thing which you have to manage where you need to selectively

insert or take the date out you need data structures now I hope I was able to

explain you the idea behind data structures now let’s go ahead and

understand what is mean by algorithms now what I told you about data structure

is that it is about efficiently retrieving and storing of data and this

is where algorithm comes into picture okay now for example let’s say I had

this particular card and I have to keep this particular card over here how do I

go about putting this card over here so I am a conscious person so I can go

ahead and put it in the empty slot but how my algorithm will find the empty

slot this is what algorithm does it may go from here it may go from here it will

do binary search or something like that this is what algorithm is okay an

algorithm will find the proper place and put this particular card in it now when

I need some cash I directly go over here right but how does my algorithm do that

so my algorithm will try to find out okay cash is there so I am going to

search here card is here so I am going to search here that’s how algorithm

works this is what algorithm is and this is what algorithm does so guys I have

explained you what are data structures and algorithms forget everything

whatever someone has taught to you just remember

this and try to write it in your own words okay

anything that is arranged is a data structure library is a data structure

whatever Amazon first page you get or any e-commerce website page you get that is data structure because as soon as you type electronics you get your

electronics right because things are arranged in that particular way even if

you go to a supermarket you don’t search complete supermarket because supermarket

is also a data structure data structure is all about arrangement of data so that

it’s easy to find and store the data in the data set and that is what data

structure is all about whatever data structure you can think of binary search

red black trees AVL trees bubble sort heapsort quicksort anything for that

matter everything deals about either storing

of data or retrieving of data from the available data set and that too in the

most efficient way you will say that okay fine but why there are multiple

algorithms well multiple algorithms are required because the requirement of

fetching and storing data from the data set differs from different requirements

for example if one module just want cash not the card so it’s a waste of effort

to look into this and this place right so we use the algorithm which just looks

into this particular place to get the cash that’s why based on your requirement you decide which algorithm to use got it guys this is what data structure

and algorithm is all about if you have understood it write your own definition

and put it in the comment section feel free to reach out to me in case you face

any issue or difficulty thanks a lot guys thanks for watching please do

subscribe to my youtube channel and press the bell icon follow me on social

media believe me I’m gonna come up with lots and lots of interesting contents

helpful for every software developer on the planet thanks a lot guys till the

next time Thanks good day take care

very good work sir.. please start a complete batch with the code we are ready to pay and take the course

Excellent πππ

Nice video your videos are just class apart