Data Structures and Algorithms for Beginners

Data Structures and algorithms for beginners. Ace your coding interview. Watch this tutorial to learn all about Big O, arrays and linked lists!
🚀 Get interview-ready with my full course: bit.ly/2OwNTxx
👍 Subscribe for more awesome content: goo.gl/6PYaGF
Need Java foundations first? Check out my tutorial: • Java Tutorial for Begi...
✋ Stay connected:
- Twitter: / moshhamedani
- Facebook: / programmingwithmosh
- Instagram: / codewithmosh.official
- LinkedIn: / codewithmosh
💡 What you'll learn:
- Big O notation for analyzing code efficiency.
- How to implement and use arrays.
- The basics of linked lists.
👉 This tutorial is perfect for you if:
- You're preparing for technical job interviews.
- You want to improve your coding fundamentals.
- You're a CS student learning these concepts.
Let's get started!
📖 TABLE OF CONTENT
0:00:00 Intro
0:01:04 What is Big O?
0:03:03 O(1)
0:04:32 O(n)
0:08:17 O(n^2)
0:10:41 O(log n)
0:13:20 O(2^n)
0:14:10 Space Complexity
0:17:53 Understanding Arrays
0:21:03 Working with Arrays
0:24:32 Exercise: Building an Array
0:27:24 Solution: Creating the Array Class
0:30:43 Solution: insert()
0:35:03 Solution: remove()
0:39:54 Solution: indexOf()
0:42:23 Dynamic Arrays
0:46:11 Linked Lists Introduction
0:46:41 What are Linked Lists?
0:51:16 Working with Linked Lists
0:54:40 Exercise: Building a Linked List
0:56:05 Solution: addLast()
1:02:15 Solution: addFirst()
1:04:28 Solution: indexOf()
1:06:23 Solution: contains()
1:07:28 Solution: removeFirst()
1:11:52 Solution: removeLast()
#ComputerScience #Coding #Programming

Пікірлер: 677

  • @programmingwithmosh
    @programmingwithmosh24 күн бұрын

    🚀 Get interview-ready with my full course: bit.ly/2OwNTxx 👍 Subscribe for more awesome content: goo.gl/6PYaGF

  • @evilmonk47
    @evilmonk474 жыл бұрын

    For Mobile Users 0:00:00 Intro 0:01:04 What is Big O? 0:03:03 O(1) 0:04:32 O(n) 0:08:17 O(n^2) 0:10:41 O(log n) 0:13:20 O(2^n) 0:14:10 Space Complexity 0:17:53 Understanding Arrays 0:21:03 Working with Arrays 0:24:32 Exercise: Building an Array 0:27:24 Solution: Creating the Array Class 0:30:43 Solution: insert() 0:35:03 Solution: remove() 0:39:54 Solution: indexOf() 0:42:23 Dynamic Arrays 0:46:11 Linked Lists Introduction 0:46:41 What are Linked Lists? 0:51:16 Working with Linked Lists 0:54:40 Exercise: Building a Linked List 0:56:05 Solution: addLast() 1:02:15 Solution: addFirst() 1:04:28 Solution: indexOf() 1:06:23 Solution: contains() 1:07:28 Solution: removeFirst() 1:11:52 Solution: removeLast()

  • @rohitdhas4438

    @rohitdhas4438

    3 жыл бұрын

    Thanks

  • @Someone-nt8wz

    @Someone-nt8wz

    2 жыл бұрын

    Big help

  • @tibettenballs4962

    @tibettenballs4962

    2 жыл бұрын

    you know mosh used to touch me, then force me to touch my sister back in syria?

  • @adamurray88

    @adamurray88

    2 жыл бұрын

    Un

  • @saravananrhagavan7349

    @saravananrhagavan7349

    2 жыл бұрын

    Thank you

  • @chetanpatteparapu7600
    @chetanpatteparapu76004 жыл бұрын

    This is the most underrated course ever. Best resource to master data structure and algorithms...

  • @iamserda

    @iamserda

    3 жыл бұрын

    'master, no' but certainly to get a basic understanding of big, ds and algo. you still get a thumbs up!

  • @renukaprincy1619

    @renukaprincy1619

    2 жыл бұрын

    @@iamserda qqqqqqqqqqyhncf

  • @mozart0

    @mozart0

    2 жыл бұрын

    @@renukaprincy1619 you OK?

  • @robertstimmel1100
    @robertstimmel11003 жыл бұрын

    I'm only about a half-hour into this lesson, and I can already tell that it will be very helpful. I was trying to follow along with an eight-hour video posted by a Google engineer and was really struggling. Your approach to teaching this concept is working much better for me. Thank you for posting this video!

  • @philly_zzz6147
    @philly_zzz6147 Жыл бұрын

    Just wanted to say how much I appreciate you as a teacher Mosh -- you communicate things so well and make math and computer science genuinely fun to learn

  • @GeekyMan
    @GeekyMan3 жыл бұрын

    A huge thank you Mosh! You don't know how much I love to watch your videos. It's a strange matter in me that I am never satisfied by just good explanation, I also need to have nice presentations too! Just like the one you are having. Your videos are the just perfect blueprint of the kind of educational videos I always wanted to watch...once again, thanks mosh. You really get my back everytime I need to have such nice explanations of any topic!!❤️

  • @UnkownUnkown01
    @UnkownUnkown01 Жыл бұрын

    Huge thanks to you, I finally understand linked lists and how to work with them, before this I was struggling a lot with them. Now I understand them very well. You're amazing for giving us this for free.

  • @jaimerojas6578
    @jaimerojas65784 жыл бұрын

    Thanks Mosh this is just what I needed to level up as a developer right now

  • @nasser_omar
    @nasser_omar4 жыл бұрын

    You aren't just an amazing man you are wonderful with the meaning of the word. A lot of thanks to you. Every single word is useful than you imagine

  • @jakubsluka4168
    @jakubsluka41682 ай бұрын

    Im 5 yrs uinto professional programming, and what a shame, I had no clue about linked list. Thanks for this swift and useful tutorial.

  • @lumbardhsallauka5608
    @lumbardhsallauka5608 Жыл бұрын

    Thank you Mosh ! Yo're so fluent in programming, very clear & easy to be understood, always positive and having fun while coding.

  • @vijaypanhale8360
    @vijaypanhale83602 жыл бұрын

    This tutorial from Mosh is really changed my mind to look towards Data Structures.A lot thanks and support to Mosh.Never find this kind of tutorial which is explained in more easy and detailed way. 🙌

  • @alexandrosntousias1496
    @alexandrosntousias14964 жыл бұрын

    Mosh, you're an amazing tutor! KZread suggested me your design patterns lesson and from that moment I can't stop watching your videos. I'm also going to buy the whole courses from your website. I would like to point out a correction (or rather an omission) on this video though. Although you correctly pointed out that the time complexity of removing the last item from a linked list is O(n), for the Java LinkedList is actually O(1) since it's implemented as a double linked-list. Again, thank you for your awesome work!

  • @rehanansari8154

    @rehanansari8154

    3 жыл бұрын

    ya you're right I was also thinking the same

  • @kanchanvyas5490

    @kanchanvyas5490

    3 жыл бұрын

    But he said we consider the worst case always.So O(n) should be correct

  • @alexandrosntousias1496

    @alexandrosntousias1496

    3 жыл бұрын

    @@kanchanvyas5490 ​ For Java's implementation of LinkedList, the worst case for removing the last item is also constant O(1). Basically, it maintains a pointer to the last item of the list, and given that the list is implemented as double linked list it can access the item before last and easily remove the last item.

  • @acuraintdohc
    @acuraintdohc4 жыл бұрын

    Great video! For the removeAt() method for Array, I believe if you have an Array on length 1 and one element within it, passing 0 as the index will cause an array index out of bounds exception.

  • @nipun8298
    @nipun82984 жыл бұрын

    Best way to get it started! I just love your tutorials Mosh . Hope you never stop posting your tutorials.

  • @user-yj9hs9cu5h
    @user-yj9hs9cu5h4 жыл бұрын

    I followed to here from the beginner’s course. The interactive part is the key. After doing the interactive exercises I was like aha I got it. Before that I read other’s code just fine, but cannot write one myself.

  • @munapadhi8723
    @munapadhi87233 жыл бұрын

    Mosh is the one best computer science teacher in the world, i love your all the courses thanks for your hard working.

  • @elij8852
    @elij88523 жыл бұрын

    Mosh, in my internship over a year ago, I studied your course on React, built an awesome application, and won a lot of praise from my co-workers. I just got laid off (by the same company) and back to the job hunt. I'll check out this course. I have a lot of faith in your content! Thanks for making these for us.

  • @elij8852

    @elij8852

    2 жыл бұрын

    @shreyas k I'm now working in FAANG so it turned out well!

  • @akshaysharma145

    @akshaysharma145

    2 жыл бұрын

    @@elij8852 could you please share which courses did you take from mosh or any other source specially for react and ds and algo in java? for 2022

  • @elij8852

    @elij8852

    2 жыл бұрын

    @@akshaysharma145 For sure. Since then I took his HTML/CSS, Git, and Redux courses

  • @akshaysharma145

    @akshaysharma145

    2 жыл бұрын

    @@elij8852 can you please share your honest review? Also if you have taken ds and algo one? Are all these courses up to date?

  • @elij8852

    @elij8852

    2 жыл бұрын

    @@akshaysharma145 forgot about the DS and Algo one. I took that too. As far as I remember, they were all up to date when I took them, all within the last couple years. I thought they were all great, but looking back on the Redux course, I feel I could have just taken a look at the documentation to learn what I know

  • @eddy4638
    @eddy46382 жыл бұрын

    I LOVE YOU FOR EXPLAINING IT WITH ANIMATIONS AND MAKE IT LOOK SUPER EASY. GOD BLESS YOU.WITHOUT UNDERSTANDING THE BASICS IT IS HARD TO MASTER THE DS AND ALGOS.

  • @shafiqsoherwardy9823
    @shafiqsoherwardy98234 жыл бұрын

    Sir mosh, you're way of teaching is best, I love to be as a your student.

  • @marwalucia9594
    @marwalucia9594 Жыл бұрын

    for sure i had never saw such a teacher like you in this world ....... you are beyond the time

  • @PaladinJenkis
    @PaladinJenkis3 жыл бұрын

    Even though Java allows bracketless single statement for loops, it's good practice to use brackets anyway. It's especially helpful in Pull Request reviews and manual resolving of merge conflicts.

  • @goodmanwiseman303

    @goodmanwiseman303

    2 жыл бұрын

    I dont understand your last sentence at all, but I gave you a thumbs up anyway, because I find brackets really helpful.

  • @PaladinJenkis

    @PaladinJenkis

    2 жыл бұрын

    Imagine you have a bracketless if statement somewhere in loop and you add another condition to that, be it by accident or through a merge conflict. what happens now is that instead of being executed only if the condition applies, it will be executed every time. This entire concept makes no sense, it makes the code incoherent and easy to break. I'd be extremely cautios to take advise from someone who has such a coding style, that's what I am trying to say.

  • @colbyboucher6391

    @colbyboucher6391

    2 жыл бұрын

    @@goodmanwiseman303 They're talking about collaborating on projects with Git.

  • @viktorhristov7193
    @viktorhristov71936 ай бұрын

    39:03 in the removeAt() method the for loop's condition should be i < count - 1, because inside it's block you access items[i + 1] which in case where count == items.length will throw an ArrayIndexOutOfBounds exception. I know that count can't be equal to the length of the array because you resize it when that happens, but It is still a small mistake since your method will be dependent of your insert method so I decided I should mention it. Overall the video is very well made and explains everything with simple examples.

  • @ajayspatil
    @ajayspatil3 жыл бұрын

    Dear mosh, your courses are the best I’ve ever taken, I never thought that Data structures and algorithms would be this easy, all thanks to you Mosh!

  • @akshaysharma145

    @akshaysharma145

    2 жыл бұрын

    have you taken the paid ds and algo java course? is it worth buying to crack interviews?

  • @rosemwangi5635

    @rosemwangi5635

    Жыл бұрын

    @@akshaysharma145 I’m here waiting to get this answer too

  • @julianbecerratellez6334

    @julianbecerratellez6334

    Жыл бұрын

    @@akshaysharma145 is worth every penny.

  • @akshaysharma145

    @akshaysharma145

    Жыл бұрын

    @@julianbecerratellez6334 have you taken the course? Are all types of data structures along with important questions covered?

  • @SauravKumar-ou1cs
    @SauravKumar-ou1cs3 жыл бұрын

    Even though i knew most of the concepts in this but learned some amazing things Thank you mosh

  • @sadiyanoorain9251

    @sadiyanoorain9251

    2 жыл бұрын

    Before starting the course I wanted to know in which language is he teaching? Is it DSA in C++?

  • @deliveringIdeas

    @deliveringIdeas

    2 жыл бұрын

    @@sadiyanoorain9251 Java. If you are fluent in c++ look at abdul bari's DSA

  • @sadiyanoorain9251

    @sadiyanoorain9251

    2 жыл бұрын

    @@deliveringIdeas Oh okay Thanks 😃😃😃

  • @M4CARBINE556
    @M4CARBINE5564 жыл бұрын

    Awesome video! Thank you so much for making these videos. I'm going to purchase the full course.

  • @MandolinSashaank
    @MandolinSashaank4 жыл бұрын

    Finally. I was waiting so long for this. Thank you so much once again mosh 😀

  • @ishanpokhrel5972
    @ishanpokhrel59723 жыл бұрын

    Thanks a lot mosh❤you cant imagine how much you have made our learning easy and efficient💘

  • @fabricationmind6835
    @fabricationmind6835 Жыл бұрын

    You have a great teaching style, Mosh! Now I have a clear concept of Big O notations.

  • @3monsterbeast
    @3monsterbeast3 жыл бұрын

    Mosh, I have bought this course on your website and let me just say - the way you teach how to create our own methods to manipulate arrays is exactly how my d.s. & a. class in school should have taught us but didn't! We are essentially learning how the original Java classes were developed from scratch with your course! SO COOL

  • @marcspect

    @marcspect

    Жыл бұрын

    BC

  • @sanany6783
    @sanany67834 жыл бұрын

    You are awesome Mosh! Great tutorial. Mosh, please make a course on "Design Patterns".

  • @fernandorenegado6685
    @fernandorenegado66854 жыл бұрын

    For the removeLast() method I suggest to use two pointers say current and next both initialized to first. And the while(next!=null) { current=next; next=next.next;} When the loop terminates the current points to the last node. This will no longer need the creation of the getPrevious() method.

  • @ricardohernandezmendez4207
    @ricardohernandezmendez42072 жыл бұрын

    This video really helped me understand the linked list very easily. Thanks Mosh.

  • @codevalley9511
    @codevalley95114 жыл бұрын

    Thanks sir We all r waiting for this from a long time

  • @oluwatoniakinjiola8379
    @oluwatoniakinjiola8379 Жыл бұрын

    This was simple and easy to follow. Great tutorial! Thanks Mosh.

  • @thepetiteotaku
    @thepetiteotaku11 ай бұрын

    This is an amazing course! Although I had to tweak my code when watching the solutions, I was able to write a lot of the implementation myself based solely on the hints given and the theory behind the logic. I will most likely buy the course as I want to learn more about the other data structures. Thank you

  • @sabinasivanlivny9694
    @sabinasivanlivny96942 жыл бұрын

    Thank you for your videos. You explain everything so well and clear. I hope to watch all of them :)

  • @arslanbhaleem
    @arslanbhaleem4 жыл бұрын

    Really good to see you..I was waiting for your new course.. This is amazing. I just what to ask one question will there be any course on "Data analysis with python" or "Data science with python" as these two fields are growing day by day ? Thanks in advance:)

  • @travis8106
    @travis8106 Жыл бұрын

    There's no better feeling than when an intimidating concept clicks. Thanks Mosh!

  • @unstable_diffusion
    @unstable_diffusion4 жыл бұрын

    I was very struggling with why the binary search has log(n) complexity until I learned that CS uses logarithm base 2, unlike in math with 10. It all made sense after realizing that.

  • @internetbscop5364

    @internetbscop5364

    3 жыл бұрын

    Not quite right, the base of the logarithm is defined by the nature of the algorithm. The logarithm can use different base depending upon the type of algorithm.

  • @AtulKumar23

    @AtulKumar23

    2 жыл бұрын

    @@internetbscop5364 00

  • @girish90
    @girish903 жыл бұрын

    this is a great tutorial! I absolutely loved it.

  • @seanli6339
    @seanli63393 жыл бұрын

    should make a series on more advanced data structures... like stacks, queues, generics, heaps, trees, graphs, etc.

  • @seanli6339

    @seanli6339

    3 жыл бұрын

    @@vasachisenjubean5944 where?

  • @lama-tp9lh

    @lama-tp9lh

    3 жыл бұрын

    @@dlengelkes I checked it but it's not free help plz !!

  • @dlengelkes

    @dlengelkes

    3 жыл бұрын

    @@lama-tp9lh here is another course on youtube. kzread.info/dash/bejne/g6GokrOwqqjTmJM.html

  • @lama-tp9lh

    @lama-tp9lh

    3 жыл бұрын

    @@dlengelkes !! thanks for helping me

  • @lama-tp9lh

    @lama-tp9lh

    3 жыл бұрын

    @@dlengelkes ​ can u send me your e-mail

  • @mikedelta658
    @mikedelta6584 ай бұрын

    Thank you Mosh. As I'm preparing for Software Engineer position interview with FAANG company, this is too essential to refresh my knowledge.

  • @sanujatharinda6525
    @sanujatharinda65254 жыл бұрын

    Thank you so much. This helped me so much. I am going to purchase the full course. I also want to enroll several other courses of yours as well. I just want to know if I could download the course with monthly access membership so I can study the course offline...

  • @christinetapere7632
    @christinetapere76323 жыл бұрын

    This is so useful specially now that we students need to study and understand programming alone because of this pandemic. Thank you Mr. Mosh that u exist! You discuss data structure and algorithms better than my instructor. 😅 To more videos to watch! 😊

  • @JiggiJaxxon
    @JiggiJaxxon2 жыл бұрын

    Simply magnificent! Excellent explanation! Thank you Mosh!

  • @salaarimran9306
    @salaarimran93064 жыл бұрын

    Hi Mosh! Your videos are just awesome. I have my data structure exam after a month. So it is my humble request to pls upload video of trees,hash tables and AVL trees etc quickly so that I can prepare myself for the exam. The problem is that I cannot buy the course so pls help me in this regard. Thanks!

  • @ILovE2TRicKShoT0nMW2
    @ILovE2TRicKShoT0nMW24 жыл бұрын

    I just got done asking my CS teacher does he have any sources for learning data structures he said to use the book, and then I get home to see this in my recommendations. Some thing aint adding up

  • @AnimatedStoriesWorldwide

    @AnimatedStoriesWorldwide

    4 жыл бұрын

    i just woke up after dreaming of my school time and trying to understand why they taught us arrays before array list and then this is on my subscription list...

  • @rudranarayandash1466

    @rudranarayandash1466

    4 жыл бұрын

    Prefer book instead of video.

  • @ILovE2TRicKShoT0nMW2

    @ILovE2TRicKShoT0nMW2

    4 жыл бұрын

    @@rudranarayandash1466 I have not bought the book for this semester because we were just learning java and i had an old edition of what we needed but i am going to buy the book. The book we needed was "Introduction to Java Programming and Data Structures, Comprehensive Version, 11th Edition"

  • @evangelosspyromilios5994

    @evangelosspyromilios5994

    4 жыл бұрын

    Google knows us better than our teachers

  • @marko_pasa

    @marko_pasa

    4 жыл бұрын

    Easy. Google reads your mails, listens your phone conversations.

  • @faisalahmedsiddiqui6517
    @faisalahmedsiddiqui65173 жыл бұрын

    Brilliant Resources You Provide Mosh 👍 You are an Excellent Teacher!

  • @kotic007
    @kotic0074 жыл бұрын

    Love the graphics - esp the coffee in the beginning! Content is always exceptional!I have the bundle :)

  • @waqasbhatti4478

    @waqasbhatti4478

    3 жыл бұрын

    @@programmingwithmosh hi mosh can u make tutorials on javafx or java frameworks

  • @TechnicalAnkesh
    @TechnicalAnkesh3 жыл бұрын

    Hey, , Mosh you really made coding simple thank you so much😊

  • @lianhong542
    @lianhong5422 жыл бұрын

    Having a basic knowledge of java and having a Data Structure course currently, Im learning two Course at a time. Thank you.

  • @brianphury8509
    @brianphury85093 жыл бұрын

    I wish i could pay for a full course..... but i can't.... Thank you for the freebies you make available! well appreciated you are the best teacher i have had so far

  • @ragnarok55
    @ragnarok554 жыл бұрын

    Thank you for you uploading...i am learning python and java through u r videos but what use for me I don't have any programming job but still learning 😂 but I like it...

  • @israel4961
    @israel4961 Жыл бұрын

    i feel sorry for those college professor who taught us like every thing about CS is difficult to understand. Mosh changed the game and made it to easy to understand every CS courses. we pay a lot for colleges for nthn but to stress our selves with exam with 0 knowledge. but with mosh we enjoyed the free courses and gain knldg with great presentation skill. we need 100 more of you in the tech world . THANK YOU!!

  • @aginamabednego
    @aginamabednego Жыл бұрын

    Mosh is simply a genius. His videos on programming concepts can be understood by ANYBODY

  • @Fifufjdjjdhdhdbd
    @Fifufjdjjdhdhdbd2 жыл бұрын

    Great class! Have been waiting for your Java Advanced course - have you gotten any closer to releasing it?

  • @loverboyhk
    @loverboyhk4 жыл бұрын

    I bought the course. Awesome teaching!

  • @MatheusFroes16
    @MatheusFroes164 жыл бұрын

    Amazing content. Thanks for sharing!

  • @ABHIJITMSAWANT
    @ABHIJITMSAWANT Жыл бұрын

    Super cool explanation, I think this is the best video that explains time complexity concepts so easy. I wish you were my engineering professor :)

  • @robertstimmel1100
    @robertstimmel11003 жыл бұрын

    I'm trying to follow along with the coding exercises in C#. When making the dynamic array, my results were kind of different. I have heard that C# and Java are fairly similar, but I was able to add or remove items from my array by just adding/deleting from inside the curly brackets. Am I missing the point and doing something wrong?

  • @andrecjpite
    @andrecjpite4 жыл бұрын

    Well, that moment when you ask your parents for Christmas, a SUBSCRIPTION to watch Mosh courses. As soon as I saw you had a video about this topic. Instantly bought a subscription to your courses and told my parents it would be my christmas gift. :D Thanks this would be much appreciated since I am having troubles with how my teacher explain this at the university. Lots of variables with a,b,c,s,kmnnakfwofkvms and no real examples.

  • @haidarali6806
    @haidarali68064 жыл бұрын

    You Are the Great Sir You really Make the thing easy... Thank You sir that is the First Time I understand that what is DataStructure

  • @superpcstation
    @superpcstation4 жыл бұрын

    Thanks Mosh! When can we expect the design patterns course? :)

  • @connieczhang54
    @connieczhang544 жыл бұрын

    Thanks so much, Mosh! It's a wonderful class.Thanks for being so patient with us. Thanks for sharing!

  • @dnyvmv
    @dnyvmv3 жыл бұрын

    It is a great video. A great tutorial. There is a slight error in the addFirst method. It is necessary to create the link between the first and second node. I'm sure I'll buy the course. Congratulations!

  • @akashicpy
    @akashicpy4 жыл бұрын

    Thank you Mosh! An awesome video as always (:

  • @sebailing6219
    @sebailing62193 жыл бұрын

    Very Perfect Java Programming Teaching Materials! Very Perfect Professors!

  • @LarsErikRisholm
    @LarsErikRisholm2 жыл бұрын

    This course really helped clarifying some things i needed to know. Thanks a lot! (btw i also enrolled in the ultimate java and python courses and loved it!) Keep up the great work!

  • @akshaysharma145

    @akshaysharma145

    2 жыл бұрын

    could you please share your review about the ds and algo course on the website?

  • @bogo4064
    @bogo40644 жыл бұрын

    Wow, I'm taking Data Structure in Java next semester and this will be very helpful! Thanks!

  • @rozdede

    @rozdede

    4 жыл бұрын

    Are you going to be a programmer.? Which university are you going?

  • @bogo4064

    @bogo4064

    4 жыл бұрын

    @@rozdede I hope so! I'm attending at U of M.

  • @wolflearn8966
    @wolflearn89664 жыл бұрын

    that is amazing course teacher that what i need thx a lot :)

  • @antonyspiano2403
    @antonyspiano24032 жыл бұрын

    I believe teaching is a wonderful gift from the Almighty , and you are blessed abundantly for sure . Amazing videos Mosh. I have been following urs for Python and now for DS .. Thanks!!

  • @abderazakla3ta3ta25
    @abderazakla3ta3ta253 жыл бұрын

    40:47 there is a small issue in the loop in the removeAt (i (i< cout-1)

  • @suryagowrisetti1112

    @suryagowrisetti1112

    3 жыл бұрын

    Yes exactly. But for him it ran fine with exceptions. How is that?

  • @shiffin_chippe
    @shiffin_chippe4 жыл бұрын

    I was just thinking about buying your course...and this popped up

  • @landsgevaer
    @landsgevaer4 жыл бұрын

    @39:03 Shouldn't that loop end at i < count-1 ? Alternatively, decrease the count with count-- **before** the loop...

  • @alikifayat

    @alikifayat

    4 жыл бұрын

    Yes, I also noticed that

  • @redsantelices8498

    @redsantelices8498

    4 жыл бұрын

    Yes, I noticed it, but if you are going to decrement the count it will thow an out of bounds exception if your array has a size of 1

  • @landsgevaer

    @landsgevaer

    4 жыл бұрын

    @@redsantelices8498 No it won't. You'll get for (int i = 0; i Then, the body of the loop will not be executed at all, which is what should happen.

  • @redsantelices8498

    @redsantelices8498

    4 жыл бұрын

    @@landsgevaer oh, I meant if the array size is 0.

  • @landsgevaer

    @landsgevaer

    4 жыл бұрын

    @@redsantelices8498 that is caught a few lines earlier where an error is thrown if index >= count. And actually, getting an error when removing an element from an empty list seems entirely justifiable... ;-)

  • @Inandoutpk
    @Inandoutpk Жыл бұрын

    You Explained Big O in the easiest way possible, Thanks M.

  • @EduardoMartinez-dm5pp
    @EduardoMartinez-dm5pp Жыл бұрын

    13 minutes of video have thought me more than 1 whole week coding at hackerrank or doing coding excercises to find the proper algorythm... you sir are a master of masters

  • @khumendrasinha506
    @khumendrasinha5064 жыл бұрын

    Thank u very much for this mosh Once again you rocked!💜💜💜

  • @whose69
    @whose693 жыл бұрын

    39:20 Note that the *removeAt* function is not written properly: *1* . *i* *

  • @suryagowrisetti1112

    @suryagowrisetti1112

    3 жыл бұрын

    Came to comments wanting to say this. But deep inside I knew it has already been said. Found my saying already said. I have no more say to say, except to say that it is well said. Well said.

  • @suryagowrisetti1112

    @suryagowrisetti1112

    3 жыл бұрын

    But again his machine ran it fine. How was that possible?

  • @ongtuananh4416

    @ongtuananh4416

    2 жыл бұрын

    I also saw this point but I think even with this one you will remove the element but the last items[i+1] still remains unchanged, so you might need to have another check to deallocate the last element..

  • @pareshmkulkarni

    @pareshmkulkarni

    2 жыл бұрын

    Also, in the same removeat methond, after completing loop, count-- is added to remove last item which is still there. However count is just a tracker and does not really remove anything from Array. Because it is being used in Print method, it is giving impression that array does not include it. Please comment.

  • @burtcharleslancaster1501
    @burtcharleslancaster15012 жыл бұрын

    What a rabbit hole to go down from using yaml to learning about structured data thanks for the vid definitely helpful

  • @kinki2474
    @kinki2474 Жыл бұрын

    Thank you a lot, I did all of this in c. I have been coding a while for hobby, but I never knew about big O & ...

  • @Shakas420
    @Shakas420 Жыл бұрын

    This is awesome my man, keep it up!

  • @nishantkumarpradhan8223
    @nishantkumarpradhan82233 жыл бұрын

    Mosh you have a great way of explanation ❤️

  • @madhavin4918
    @madhavin49184 жыл бұрын

    Awesome tutorail . Thanks Mosh . Could you please share the full course link

  • @tidymind6677
    @tidymind66773 жыл бұрын

    speech delivery is perfect... no rapidly speech middle of video. awsome

  • @mobalic8673
    @mobalic86733 жыл бұрын

    Excellent explanation. Thank you so mush Sir 🙏🙏🙏

  • @samoladapo7691
    @samoladapo7691 Жыл бұрын

    Best explanatory videos for Introduction to Programming

  • @noahsea7907
    @noahsea79073 жыл бұрын

    Hi Sir Mosh, could you please provide a print method? Im still confused about the topic :(

  • @medhnhadush4320
    @medhnhadush43202 жыл бұрын

    even your voice is soothing and it gives me motivation to watch more

  • @sethmanning6493
    @sethmanning64932 жыл бұрын

    I'm having trouble making sense of lines 22 and 23 at 1:01:22. I'm not familiar with Java and I know there's something to do with instances of objects being pointers, but I still don't understand how the properties of a pointer stay the same upon reassignment. EDIT: I understand now. On line 22 'last' in 'last.next' is an address who already has a node referencing it (its previous node). When we change 'last' on line 23, we're not changing the address that its previous node is referring to.

  • @mouradaouinat8721
    @mouradaouinat87214 жыл бұрын

    you're simply without fluff AMAZING!

  • @mouradaouinat8721

    @mouradaouinat8721

    4 жыл бұрын

    Programming with Mosh will do!

  • @Adarsh-pf8jc

    @Adarsh-pf8jc

    3 жыл бұрын

    Are u Moroccan ?? Do u learn java ?

  • @codeswithankit4316
    @codeswithankit43164 жыл бұрын

    Finally wait over, Mosh is back with Christmas gift

  • @vikramravichandran9607

    @vikramravichandran9607

    4 жыл бұрын

    @@programmingwithmosh We are so excited :)

  • @rehoboth9971
    @rehoboth99714 жыл бұрын

    Finally have been waiting for this for a very long time thanks very much @mosh

  • @josephwong2832
    @josephwong28324 жыл бұрын

    Love your teaching style Mosh

  • @JoaoNzangoii
    @JoaoNzangoii3 жыл бұрын

    It is 100% worth watching!

  • @hariprasathpanneerselvam5361
    @hariprasathpanneerselvam53612 жыл бұрын

    Hi Mosh, Make Data Structures and Algorithms video using Python, It would be easily understandable and your courses are great🤩

  • @bern1223
    @bern12232 жыл бұрын

    I already have the course but I just came here to say that you are definitely more worth it than Joma-Tech charging $100 a year for his classes. Thank you for this awesome resource!

  • @akshaysharma145

    @akshaysharma145

    2 жыл бұрын

    could you please share which courses did you take by mosh? also if the react course is worth buying in 2022 as the version mentioned is 16.2. And hows the ds and algo course?

  • @arjun685
    @arjun685 Жыл бұрын

    Hi Mosh Thank you for the video. It was really good. Is the full tutorial available in udemy?

  • @noxy281
    @noxy2813 жыл бұрын

    This was really helpful thx!

  • @avi933
    @avi9334 жыл бұрын

    Thanks Mosh for keep upgrading us