Operations on Arrays in Data Structures: Traversal, Insertion, Deletion and Searching

Поділитися
Вставка
  • Опубліковано 24 лис 2024

КОМЕНТАРІ • 1,2 тис.

  • @CodeWithHarry
    @CodeWithHarry  4 роки тому +255

    Notes have been uploaded - codewithharry.com/videos/data-structures-and-algorithms-in-hindi-9
    Please share this video guys! It will make it easy for me to provide better and better free quality content!
    Here is my Instagram - instagram.com/CodeWithHarry

    • @loneeditor6878
      @loneeditor6878 4 роки тому +4

      Sir aaap nai Jarvis wala video banay but sir code pura theek likha
      Par computer bol nahii pata
      Actually sound nahii Aaarahi
      Plzxzz help

    • @hiphopm7069
      @hiphopm7069 4 роки тому +2

      Sir suru se coading sikhaye na PLZZ sir

    • @hiphopm7069
      @hiphopm7069 4 роки тому +2

      PLZZ sir suru se coading sikhaye na PLZZ sir

    • @hiphopm7069
      @hiphopm7069 4 роки тому +3

      Sir aap suru se coading sikhaye na plz sir aap ka subscribe bahut Jada badhega

    • @hiphopm7069
      @hiphopm7069 4 роки тому +3

      Sir aap suru se coading sikhaye na plz sir aap ka subscribe bahut Jada badhega

  • @siddhantgoyal25
    @siddhantgoyal25 4 роки тому +313

    deletion in array: Best Case: O(1), Worst Case: O(n)

    • @CodeWithHarry
      @CodeWithHarry  4 роки тому +150

      Correct! Good job! Thanks for taking part :)

    • @hiphopm7069
      @hiphopm7069 4 роки тому +9

      @@CodeWithHarry sir plese suru se v coaching sikhaye na aap ka bahut jaldi subscribe badhega app jaise koi nahi samjhata hai sir so pls aap suru se coading sikhaye plz sir 😩😩😩😩
      🇨🇮🇨🇮🇨🇮🇨🇮🇨🇮🇨🇮🇨🇮🇨🇮🇨🇮🇨🇮🇨🇮🇨🇮

    • @hiphopm7069
      @hiphopm7069 4 роки тому +3

      @@CodeWithHarry sir aap boldijiye hm wait kare aap ka video ka ya koi umid na rakhe ya unsubscribe kr de boliye aap hi sir i hope you understand
      Plz sir my help sir aap se koi pahle v kaha hai ki aap suru se coading sikhaye boliye
      Plz reply me

    • @hiphopm7069
      @hiphopm7069 4 роки тому +3

      @@CodeWithHarry sir agr is channel pr video nahi bana sakte to ek naya channel banaye suru se coading sikhaye plz sir

    • @hiphopm7069
      @hiphopm7069 4 роки тому +3

      @@CodeWithHarry sir mai bahut hi jaldi aap jaisa ban sakta hu ek bar mauka to de kar dekhiye

  • @arey.atharva
    @arey.atharva 4 роки тому +386

    Bro the amount of efforts you put in YT is just unmatched by any other!! Total support brother ♥️💯

  • @sanjaymajumder2991
    @sanjaymajumder2991 3 роки тому +23

    17:50 Best Case O(1) : When element is to be deleted from last index of the array.
    Worst Case O(size of the array) : When we have to delete the 1st (0th) index element from the array.

  • @shatviksmit3388
    @shatviksmit3388 3 роки тому +72

    17:40
    Best case -> The best case will be if we get the last index to delete. In that case, we would not have to shift anything the time taken will be a kn^0, where k is the time required to delete the item at the last index eliminating the constant we get O(1).
    Worst case -> The worst case will be if we get the item at the zeroth element to delete. In that case, we would have to shift the entire members of array hence the formula will be kn, where k is the time required to delete the item at the first index, eliminating the constant we get O(n).

    • @anonymous.271
      @anonymous.271 Рік тому +3

      Bhai kya explainnation ki h love u bro 😊😊😊👍👍👍

  • @Hiarling
    @Hiarling 3 роки тому +78

    • Best Case deletion:- (Deleting the last element of the array)
    Time Complexity: O(1)
    • Worst Case deletion:-( Deleting the 0th index element or any element between other elements)
    Time Complexity: O(n)
    (Where n is the number of elements in the array)

  • @insanick5117
    @insanick5117 4 роки тому +27

    You are best teacher in the world 🤘🏻👍

  • @editocon689
    @editocon689 4 роки тому +33

    17:44
    Best case ..O(1) : when an element is deleted from the last index in array.
    Worst Case ...O(n): when an element is deleted from the first index in an array.

  • @shadowcosmos1
    @shadowcosmos1 3 роки тому +4

    I don't know how many of viewers understands ur efforts....but I am damn sure that it takes lots of effort much more than u think for quality content and notes for each & every video.....
    Thank you....I wish and I predict u reach great heights

  • @PolarbearYGT
    @PolarbearYGT 3 роки тому +3

    17:59, Best case: 0(1) when we just delete, 0(n) when we delete and move all elements back one block. Nice video!

    • @navinpoonia589
      @navinpoonia589 3 роки тому

      worst case : O(n-1) hona chahiye na bro

  • @shashankkumar851
    @shashankkumar851 4 роки тому +6

    Bro keep going, I expect everything to be explained in very detail so that I don't need to do any course from anywhere.

  • @preyomsarkhel9932
    @preyomsarkhel9932 2 роки тому +5

    For Deletion:
    Best case--> O(1) [ Deleting the last element]
    * If order matters worst case--> O(n) [ Deleting the first element, so we have to decrease -1 index for every element of array.]

  • @aishwarya1895
    @aishwarya1895 4 роки тому +52

    Me in my online classes:"vae kuch samjh ni aaa raha "
    Then suddenly your notifications of array operations came😂😂..... Thanks bruh✌✌

  • @rudranshnemade6299
    @rudranshnemade6299 2 роки тому +2

    17:42
    For deletion in arrays
    0(1) :- when we want to delete the last element of array.
    0(n) :- when we want to delete the first element of array.

  • @Shubham-jz7ec
    @Shubham-jz7ec 4 роки тому +4

    Bhai ki mehnat ke liye ek like aur ek comment per person to banta hi h 👍. Thank u Harry bhai

  • @HiveSync
    @HiveSync 3 роки тому +1

    serving the humainity is very good quality of someone.
    Harry bhai thank you so much for making environment to seek programming efficiently,easily.

  • @pratikkarale8461
    @pratikkarale8461 4 роки тому +8

    17:55
    if the element that has to be deleted is at the the lastmost position, then the complexity would be O(1)
    otherwise it would be O(n)

  • @VishalSoni-te7hy
    @VishalSoni-te7hy 3 роки тому +2

    You are the person who is saving life of every engineer.... I'm from civil thankyou harry

  • @shakibshaykh14
    @shakibshaykh14 3 роки тому +3

    For deletion array:- Best case 0(1) when an element has to delete from last index in array
    Worst case 0(n)
    When an element has to delete from first index in array

  • @gautamgalrani
    @gautamgalrani 4 роки тому +1

    aman bhaiya and harry bhai will change the education system ...they are revolutionary person .....full supoort

  • @tejalmohod9389
    @tejalmohod9389 3 роки тому +3

    Best case will be to delete the last element of array with time complexity 0(1)
    &
    The worst case to delete the 1st element coz we have to move all the element in this case it will take time complexity of 0(n)

  • @subhayansinha4417
    @subhayansinha4417 3 роки тому +2

    I love how he plans out his lectures. There's not many teachers who won't stutter while looking at a camera in an empty room.

  • @dewtech6256
    @dewtech6256 4 роки тому +4

    Nice Harry ! Plz try to make videos related to complex algo/programming like "Assembly Line Scheduling" , "0-1 Knapsack Problem" etc.

  • @udaysinghrana5725
    @udaysinghrana5725 Рік тому +2

    17:26
    Best Case - O(1) (Deletion at end)
    Worst Case Scenario - O(n) (Deleting First Element at 0th index)

  • @shashijaiswal688
    @shashijaiswal688 3 роки тому +8

    Summary of the video-
    Traversal(){
    //When to use traversal
    }
    Insertion, deletion(){
    Case 1:order should be maintained
    case 2:order doesn't matter.}
    Searching(){
    //Used size should be updated.
    Linear search:algo 1(previous videos)
    binary search:algo 2(previous videos)
    }

  • @nihalbhamrah4726
    @nihalbhamrah4726 5 місяців тому +1

    17:55 best case : O(1) if the element we have to delete is the last element of the array worst case : O(n) if element is at the begging and n elements are there

  • @arpanchowdhury5133
    @arpanchowdhury5133 4 роки тому +46

    Harry Bhai be like : Traversal nehi batayunga , woh sab to 2+2 jaise hain
    Also Harry Bhai : writes the whole traversal process while telling so.. 😂😂

    • @adarshchaurasia4355
      @adarshchaurasia4355 4 роки тому +5

      Ur nai batauga bolke puri Ramayana bta dete mahan hai Apne Harry bhai 😂😂🤣🤣

    • @poorvashinde8059
      @poorvashinde8059 4 роки тому +1

      2*2= 4 ka example tha

    • @aryangangotia9240
      @aryangangotia9240 4 роки тому +1

      @@poorvashinde8059 iska kya mtlb?

    • @poorvashinde8059
      @poorvashinde8059 4 роки тому +1

      @@aryangangotia9240 harry Bhai ne multiplication ka example Diya tha addition ka nahi

  • @tukendrakulkarni3849
    @tukendrakulkarni3849 2 роки тому +1

    17:43 deletion time complexity best case O(1) worst case O (n)

  • @advikmalwa379
    @advikmalwa379 4 роки тому +6

    bhaiya aapke bas 521 views kuu hai
    iss video pr to 1m + hone chahiye the
    😔😔
    i really appreciate how much hardwork u do to bring video every day
    keep working hard u will surely get the results
    💪💪

  • @souravmandal3868
    @souravmandal3868 2 роки тому +1

    17:52 --> Best case O(1) and the Worst case is going to be --> O(n)

  • @aniket_kalta
    @aniket_kalta 3 роки тому +6

    😂😂mko apni ungli gandi krne pdege 😂never gets bored with his way of teaching adding small relatable stories 🌼🌼
    Harry Potter of coding 😗

  • @Gaurav_chandnani
    @Gaurav_chandnani 2 роки тому

    You are really a best teacher in this whole world.... Sorry in this whole universe ☺

  • @shauryakumar7544
    @shauryakumar7544 4 роки тому +7

    sir i want a vedio on how to get employed in google with python or any programming language as i am not having any degree

  • @siddhantkumar6171
    @siddhantkumar6171 2 роки тому +1

    17:54
    deletion ka best case O(1)
    and worst case O(n)

  • @ViralXtreme
    @ViralXtreme 4 роки тому +7

    *Kaun kaun Java Course chahate ho? Harry Please👨‍💻👨‍💻*
    👇 We want
    👇 Java

  • @mrRoboto1p1
    @mrRoboto1p1 Рік тому +1

    17:53 best case: deletion at end
    Avg case : deletion at middle index.
    Worst case: deletion at first index

  • @shubhamaggarwal8957
    @shubhamaggarwal8957 4 роки тому +3

    1:50 yeh sab nai bataunga
    but fir bi bata diya so that kisi ke mann me reh na jaye xd

  • @dhruvjain2874
    @dhruvjain2874 2 роки тому +2

    17:43
    Best case is O(1) --> When The last element of an array is to be deleted
    And
    Worst Case is O(n) --> When the element of first place is to be deleted and for that we have to shift all the element in (n-1)Direction !

  • @megha16_
    @megha16_ 4 роки тому +6

    24:07 He's so funnyyyyy 🤣

  • @mkgamer5226
    @mkgamer5226 27 днів тому +1

    So the worst case in the deletion operation is that when we have to delete an element from 0th index, the complexity of this case is O(n) and the best case is when we have to delete an element from the last index as we don't have to shift any element so the time complexity here is O(1).

  • @coolsai
    @coolsai 2 роки тому +70

    Zip file ko unzip nahi karne ata aur dsa sikh rahe hai 😂😅

    • @Archana-j1w2f
      @Archana-j1w2f 7 місяців тому +9

      IIT silver medalist hai don't judge anyone

    • @parthdubey3080
      @parthdubey3080 5 місяців тому

      16:04 se 16:37 tk dekho sir kya bole and phir bolo aata hai ki na

    • @yashpatil2227
      @yashpatil2227 3 місяці тому +1

      He is iit Kharagpur passout don't judge it

    • @coolsai
      @coolsai 3 місяці тому +7

      Just to clarify I am talking about students who doesn't even know how to unzip I know he is very talented that's why I am learning from him....

    • @Conquertheworldwithlove.
      @Conquertheworldwithlove. 2 місяці тому +1

      Kaise karte he zip ko unzip​@@coolsai

  • @clashingtv2527
    @clashingtv2527 2 роки тому +1

    17:50
    Best case is O(1)
    Worst case O(n)(1st element delete)

  • @programmingwithjavascript3579
    @programmingwithjavascript3579 4 роки тому +2

    17:35
    Best case of deletion :-O(1)
    Worst case of deletion :- O(n)

  • @shreemishra4521
    @shreemishra4521 2 роки тому

    Thank you Harry sir for help & पूरा प्रबन्ध ❤️

  • @atifmalik8012
    @atifmalik8012 4 місяці тому

    17:42
    Best case :- array ke last element ka deletion karna hoga to kisi bhi element ko shift karne ki jarurat nahi padegi (complexity :- O(1))
    Worst case :- array ke fist element ko delete karna hai to sabhi elements ko shift karna padega so complexity is O(n).

  • @varunthakur8592
    @varunthakur8592 3 роки тому

    One of the best channel for coding.

  • @saurabhtomar281
    @saurabhtomar281 3 роки тому +1

    17:56
    Best case : O(1)
    Worst case :O(n)

  • @gajjalaharsha
    @gajjalaharsha 4 роки тому +2

    For a element to delete in array, best case is : O(1) that is deleting last element in array no need to shift elements to left side.
    Worst case:O(n) that is deleting 1 st element i.e at 0 index in the array and we have to shift remaining n elements to left side in array.

  • @aniketsahi7778
    @aniketsahi7778 9 місяців тому

    18:03 .. Best Case O(1) and Worst Case O(n).... Thank you Harry Bhai 🫡 !!

  • @kartikaybisht637
    @kartikaybisht637 4 роки тому +2

    Congratulation for your 500k subscriber in advance.

  • @ambarsnehashishjha5742
    @ambarsnehashishjha5742 2 роки тому +1

    17:49 Deletion
    Best Case O(1)
    Worst Case O(n)

  • @DishantChoudhary-g4e
    @DishantChoudhary-g4e Рік тому

    Thanks brother if you don't exist this world idk how would i learn coding ❤

  • @easytech2105
    @easytech2105 3 роки тому

    Best case deletion:O(1) and worst case:O(n) and same for insertion also. If the insertion or deletion is at the end of the array then it will be the best condition(lucky as per harry bhaiya) and worst will be deleting or inserting from the beginning and shifting all the elements(unlucky as per harry bhaiya)

  • @antu_saha
    @antu_saha 2 роки тому +1

    17:51 base case O(1)
    worst case O(N)

  • @codeboy1561
    @codeboy1561 4 роки тому

    Follow this kind of person support them..!

  • @johnyjangid8541
    @johnyjangid8541 4 роки тому +2

    Harry Bro I am totally supporting you what a video delivering style with awesome explanations You are Awesome Keep it up dear friend

  • @SaimaKhan-c9x
    @SaimaKhan-c9x 9 місяців тому

    Thanks alot for your time and energy to explain these concept in such a easy way may God bless you

  • @skviper45
    @skviper45 3 роки тому +1

    17:52
    Worst Case -> O(n)[delete first element]
    Best Case -> O(1) [delete last element]

  • @satvikmittal4487
    @satvikmittal4487 3 роки тому +1

    17:45
    Best Case Complexity : O(1)
    Worst Case Complexity: O(n)

  • @raemenon6360
    @raemenon6360 Рік тому

    17:53 best case - O(1) kyuki agar last index ka nikaal diya toh
    Worst case - O(n) agar first index ka nikaal diya toh. Har element ko left shift karna hoga.

  • @pulkit8133
    @pulkit8133 3 місяці тому +1

    17:42 Best case-> O(1) Worst Case->O(n)

  • @shreyaschavhan5522
    @shreyaschavhan5522 4 роки тому +2

    17: 47 : Deletion - Best Case: O(1), Worst Case: O(n)

  • @VANSH00077
    @VANSH00077 3 роки тому +1

    17:45 best case will be when we have to delete the element from last index where an element is present & time complexity would be O(1) and worst case would be when we have to delete from index 0 at starting & time complexity would be O(n) !

  • @keshavcodex4173
    @keshavcodex4173 3 роки тому +2

    17:25 best case O(1) worst case O(n)

  • @ronakmaniya2005
    @ronakmaniya2005 3 місяці тому +1

    17:40
    For Deletion
    bast case: O(1)
    worst case: O(n)

  • @aasiyajamadar1642
    @aasiyajamadar1642 4 роки тому +1

    I really hope that harry should get millions and billions of subscribers 😌😌

  • @yuvisingh98
    @yuvisingh98 3 роки тому +2

    18:04 best case deletion is when u have to delete element from end
    And worst case deletion is when u have to delete element from first position

  • @tuwelshaikh5459
    @tuwelshaikh5459 2 роки тому

    18:00
    Deletion best case is last element deletion.big O(1)
    Worst case is firlst element deletion.big O(n)

  • @rvislive_
    @rvislive_ 3 роки тому

    17:51 Deletion best case: O(1) when we're supposed to delete the nth or last element. Worst Case: O(n), When we're supposed to delete the first element.

  • @Lucifer24
    @Lucifer24 2 роки тому

    17:41:00
    best case O(1)--> IF we have to delete last element of array
    worst case O(n)--> IF we have to delete first element of array

  • @VipinSingh-qf5pl
    @VipinSingh-qf5pl 2 роки тому +1

    Time stamp 17.51
    Best case O(1)
    Worst case O(n)

  • @sumapaul4299
    @sumapaul4299 6 місяців тому

    Deletion in array .
    Best case complexity = O(1)
    Worst case complexity= O(n)

  • @abhaymishra2787
    @abhaymishra2787 3 місяці тому +1

    17:51 worst case O(n) and best case O(1)

  • @privicyismyth9958
    @privicyismyth9958 4 роки тому +1

    deletion case => best case=O(1) and worst case =O(n)

  • @sharjeelashraf9887
    @sharjeelashraf9887 2 місяці тому

    For deletion the best case time complexity is O(1) and for worst case it is O(n). As it would take n number of times to swap if the number has to be deleted lets say from the 3rd index respectively.
    While for the 2nd case, to my knowledge it will remain same for both worst and best case which is O(1).

  • @prajval37
    @prajval37 Рік тому

    17:40 Best case: Deletion at last element with Time Complexity of O(1)
    Worst Case: Deletion at index 0 with Time Complexity of O(n)

  • @anonYmousFPP
    @anonYmousFPP 4 роки тому

    17:32 Time Complexity of Deletion is :-
    1) Best case = We have to remove last element ----> O(1)
    2) Worst case = We have to remove First Element -----> O(n)
    Where, n is the Size of the array

  • @harshalsonune9361
    @harshalsonune9361 4 місяці тому +1

    18:18 the best case of deletion
    O(1)
    and worst case O(n)

  • @nandinibarnwal1154
    @nandinibarnwal1154 2 роки тому +1

    Best case of deleat is 0(1)
    Worst case of deleat is 0(n)
    And thankyou so much sir for your priceless efforts❤️

  • @norendermoody6509
    @norendermoody6509 3 роки тому

    17:48 1) If element is in 0th index then on deletion complexity O(n) , 2) If element is in last Index then complexity O(1)

  • @ishitasharma6724
    @ishitasharma6724 2 роки тому

    17:45
    Best Case Time Complexity of deletion - O(1)
    Worst Case Time Complexity of deletion - O(n) where n is the no. of elements in the array

  • @nileshrawat1583
    @nileshrawat1583 2 роки тому

    You are one of the most helpful youtuber 🍀

  • @studynewthings1727
    @studynewthings1727 2 роки тому

    17:50
    best case time complexity: O(1),
    worst case time complexity: O(n).

  • @shrinathsmusic9143
    @shrinathsmusic9143 2 роки тому +1

    best case-o(1)
    wrose case-0(n)

  • @anotech4411
    @anotech4411 2 роки тому +1

    Deletion : best case O(1) , worst case O(n)

  • @sidhantjha4566
    @sidhantjha4566 2 роки тому

    17:50
    The best Case - To delete last element of the array. In this case O(1)
    The worst Case - To delete First element of the array(element at 0th index). In this case O(n)

  • @webseriesworld1791
    @webseriesworld1791 3 роки тому

    17:42
    Best Case - O(1) - constant
    Worst Case - O(n) - linearly

  • @techgourab
    @techgourab 3 роки тому +1

    17:41
    Deleation in array
    Best Case: O(1)
    Worst Case:- O(n)

  • @animeboii-zv8vo
    @animeboii-zv8vo 4 роки тому

    Best case of deletion and Best case of insertion is the same.
    and thank you sir for providing us with such free and best content

  • @comfacts07
    @comfacts07 4 роки тому

    I always watch the full ads that comes in your videos....Just because of your hardwork....🔥

  • @piyushmishra5533
    @piyushmishra5533 4 роки тому +1

    congrats for 500k subscribers Harry sir

  • @aabhasmishra3118
    @aabhasmishra3118 Рік тому

    17:42 For deletion Best case O(1) when we delete the last element and for Worst case O(n), because it depends on number of steps.

  • @WHITEDEVIL-nu5og
    @WHITEDEVIL-nu5og 2 роки тому

    Harry Bhai aap jo comedy ka use karte ho video ke beech beech main wo boht acchi hoti h iss karan agar aapki video boht jyada long bhi hoti h to accha lagta h. esa feel nahi hota ki yaar video kab kahatam hogi yahi baat aapko dusro se alag bnati h
    always be happy in your life😁😁😁😁😁
    main sochta tha ki IIT main jo bachhe padte h unko kesa padate honge but app ne wo bhi bta diya inn video ke through
    thank you for your free course.

  • @SumitKumar-gm6nc
    @SumitKumar-gm6nc 3 роки тому +2

    17:43 best case: Delete the last element of the array

  • @technicalom9359
    @technicalom9359 4 роки тому +1

    Question at 17:55
    Best Case last element of an array O(1).
    Worst Case first element of an array O(n).
    Because of shifting all elements...
    Thanks

  • @meaindriladas
    @meaindriladas 3 роки тому

    18:01 Best case time complexity for deletion is O(1) and Worst case is O(n)

  • @ambapatel9925
    @ambapatel9925 2 роки тому

    Best case deletion is : delete last element of array and it's complexity is O(1)
    worst case deletion: delete element from first position of array and shift remaining element to full empty space

  • @rajanitnavapara5761
    @rajanitnavapara5761 3 роки тому

    17:40 --> Deletion Best case : O(1) and Worst case : O(n)

  • @akashbhattacharya3981
    @akashbhattacharya3981 8 місяців тому

    17:58 best case O(1) deleting last element, worst case O(n) deleting 0th element and shift all.

  • @vinaykaushik9583
    @vinaykaushik9583 Рік тому

    17:43 The best case complexity is O(1) in that case we have to delete the element at the last position in that we have not to shift the elements by its position. Similarly the worst case complexity is O(n) in that case we have to delate the element at the zero index and we have to shift the n elements so complexity is O(n)