Introduction to Arrays and ArrayList in Java

preview_player
Показать описание
In this video we cover Arrays and ArrayList in Java from scratch.

We dive deep into how it works, the memory management, input/output, multidimensional arrays, dynamic arrays, working with functions, and solve some questions.

Take part in the learning in public initiative! Share your learnings on LinkedIn and Twitter with #DSAwithKunal & don't forget to tag us!

👉 Resources

=========================================
Timestamps:
0:00 Introduction ‌‍‍‍‌‌‍‍ ‌‍‍‌‌‌‌‍ ‌‍‍‌‍‍‌‍ ‌‍‍‌‍‌‍‌ ‌‍‍‌‍‍‍‌ ‌‌‍‍‌‌‌‌ ‌‌‍‍‍‌‌‌
1:22 Why we need Arrays?
2:58 What is an Array?
3:13 Syntax of an Array
4:26 Direct hit Program : Store 5 Roll Numbers
6:44 How does Array works?
8:42 Internal Working of an Array
10:32 Dynamic Memory Allocation
12:00 Internal Representation of Array
13:06 Continuity of an Array
16:25 Index of an Array
19:53 String Array
20:42 What is null in Java?
23:30 null is used as a default
27:55 Array Input
31:19 for-each loop
33:15 toString() Method
34:52 Array of Objects
36:25 Storage of Objects in Heap
40:21 Array Passing in Function
42:32 Multidimensional Arrays
43:36 Syntax of a 2D Array
45:20 Internal Working of a 2D Array
50:16 2D Array Input
1:01:06 2D Array Output
1:07:05 Dynamic Arrays
1:17:22 Array Functions
1:21:08 Internal Working of ArrayList
1:33:21 Questions
1:33:30 Q1 : Swaping Values in an Array
1:35:20 Q2 : Maximum Value of an Array
1:40:45 Q3 : Reversing an Array
1:44:20 Outro

#arrays #placement #dsa #interviews
Рекомендации по теме
Комментарии
Автор

I searched for a lot of courses on DSA on youtube, used to watch 1 or 2 videos, after that it became boring. But I am addicted to this course and Kunal is slowly becoming an inspiration to me. Thanks Kunal

pratikdey
Автор

me: doubt
kunal: don't worry, we will cover it in object oriented programming

nirajpatel
Автор

🎯 Key Takeaways for quick navigation:

01:19 📌 Arrays are collections of data types, and their syntax includes the data type and size declaration.
03:35 📌 Arrays in Java are stored in the heap memory, and heap objects are not guaranteed to be continuous.
09:55 📌 The "new" keyword is used to create objects in Java, including arrays. It's associated with dynamic memory allocation.
16:44 📌 Array indices start from 0, and accessing elements is done using these indices.
20:18 📌 "null" is a special literal in Java representing the absence of a value and is commonly used for uninitialized reference variables.
25:53 📚 2D arrays in Java can be visualized as arrays of arrays, where each individual index holds a reference to an array.
31:23 🔄 You can iterate through array elements using a traditional for loop, an enhanced for-each loop, or utilize the `Arrays.toString()` method for simple printing.
40:07 🔀 Java passes array references to functions by value, allowing functions to modify the original array data.
42:49 🛠️ Defining a 2D array in Java involves specifying the number of rows, while the number of columns can vary for each row.
48:26 🔄 The individual arrays within a 2D array can have varying sizes, making it possible to have jagged arrays where each row has a different number of columns.
51:01 📚 Arrays in 2D can be accessed using index [row][column].
52:40 📚 `array.length` returns number of rows in a 2D array.
56:14 📚 Nested loops are used to input values in a 2D array.
01:00:11 📚 Enhanced for loop simplifies iterating through 2D arrays.
01:04:19 📚 ArrayList in Java allows dynamic resizing without specifying size.
01:15:00 📚 ArrayList in Java is a dynamic data structure similar to arrays but with automatic resizing.
01:17:26 🧬 ArrayList capacity increases dynamically by doubling its size when it reaches a certain threshold.
01:19:39 🔍 ArrayList supports methods like add, remove, update, set, contains, and more for manipulating elements.
01:24:41 ⏰ ArrayList provides an amortized constant-time complexity for adding elements due to its dynamic resizing strategy.
01:35:48 🔄 Swap and find maximum element in an ArrayList can be achieved through simple iterative loops and basic comparison logic.
01:40:48 🔄 Reversing an array using the two-pointer method involves swapping elements from start to end and gradually moving the pointers towards each other.
01:41:28 🔃 The reverse process works for both even and odd-length arrays, utilizing start and end pointers to achieve the reversal.
01:43:05 ✨ The code for reversing an array using the two-pointer approach was demonstrated, showing how to swap and adjust pointers to reverse the array.
01:43:58 🚶‍♂️ The two-pointer method is introduced as a valuable technique, and the session concludes by highlighting the upcoming focus on more advanced array-related questions.
01:44:26 📚 Future sessions will delve into array-related questions, including rotation, palindromic arrays, sliding windows, and two-pointer techniques to enhance problem-solving skills.

Made with HARPA AI

xata
Автор

Just a suggestion. These videos are gonna be watched by millions of people worldwide over many years. As current people expect videos faster, please don't prioritise that over quality of the videos. Take your time! Make the best courses ever! ❤️ As always, you're doing a great job!

kedarhargude
Автор

Kunal kushwaha is a Gem of a person, i repeat Kunal kushwaha is a GEM of a person, period. That's it that's the comment.

gauravmp
Автор

Kunal you are the first person who explains the 'internal working' of everything! Every other course I took, the 'why' part was missing and I had lot of questions. Now everything is crystal clear! Keep up the good work! Thanks a lot🙂

vedanthbaliga
Автор

Kunal, I discovered your channel while I was trying to understand arrays and I have to say you might be one of the best programming tutorial channels out there. You explain everything thoroughly but you do not complicate things. You go in to depth and not only answer the how but the why. Thank you.

kreynusr
Автор

Haven't studied array in my life in such a way that I did today. This course is going to be loved by millions in the upcoming years. Adding a comment so that if someone finds it similar with their thoughts I'll be having notifications. Great job!

sohandas
Автор

Okey! so I'm a Cybersecurity Student from Germany, I just got to know about this channel and man ohh man it's the best thing on YouTube. Happy to learn from him. We do have DSA in our Cybersecurity curriculum because it is helpful for roles like Cybersecurity Engineer, Where we need to build efficient programs :)

WtfAnupam
Автор

See I am not a beginner in java and dsa but still I didn't knew this much knowledge regarding arrays. Indeed it's a very detailed course, kudos to kunal ✌👍🔥

jhashivam
Автор

I am also 2022 graduate like kunal, I also know ds/algo very well. I have watched dsa course of almost all big ed-tech startups in India.I can assure anyone this is not one of the but the best course in the market. Waiting for other courses by him so that I can also learn him.Such a inspiration for me

sachinsharma
Автор

I am amazed by the fact that, Kunal can make learning so easy and faster, i cannot recall when was the last time i had this efficiency in learning a language, also it is so fun, seeing him smile a little when he runs a snippet of code . I hereby declare, your are my fav person for DSA on youtube . Great work Kunal, Thanks.

jaivishmishra
Автор

I finally learned 2D arrays properly. That's because of you Kunal!! Thank you very much :)

amruthaa
Автор

You made 1hr45mins length video just to explain Arrays and Arraylist 🤩🤩
The Concepts are cleared so thorough.
Really, this is the best DSA Series❤️ one can't even think of making this that too for free.

roshanmhatre
Автор

Content is far better than paid courses😊...well done bro👍...keep bringing more such videos, I really appreciate your hard work

swayamdipttabiswaal
Автор

Hi my dear brother Kunal. I am elder by 2 years than you but you are the greatest guru I have ever seen in my life. Learning from your videos just gives me true bliss and I can just keep learning from your videos all day long. If I keep aside your fantabulous teaching skills and insightful knowledge, the intention that you carry about providing such a precious knowledge for free just make me feel that you are born for the people like me who are very curious to learn things in details.

Truly appreciate you from the core of my heart and I pray God to bless you immensely on this journey and make all the wishes true by making all our wishes true in disguise. I will be rooting for you on this journey.
My dear talented brother!

sravanikinjarapu
Автор

this course is above every other one on internet i have seen so many courses and they don't feel the same they get boring after 2-3 videos but yours is just on another level you share every bit of information which too in such a great way

faizansadique
Автор

Sir, i dont have any words to say, following your playlist from just 2 days and i am on this video, Man its so addictive, literally i was the guy who was spending whole time on Netflix just doing timepass. Getting this playlist is like getting treasures in Egypt. How can i thank you.

_xProfessor
Автор

Seriously yaar no one like u ❤️ ur amazing this session I didn't saw any single video on arrays like this . Thanku so much for ur support .

_meghavatichaudhari
Автор

You are amazing because you never create confusion when you teaching. You are a Great teacher 💯💯👍👍

avanishdubey