Lecture 23: Introduction to 2D Arrays in C++ || LeetCode Questions

preview_player
Показать описание
In this Video, we are going to learn about 2D Arrays and solve the following questions:
- Row-wise Input/Column wise input
- Linear Search over 2D arrays
- Row-wise Sum/Column wise Sum
- Largest Row sum
- Wave Print
- Spiral Print
- Rotate a Matrix by 90 degrees
- Search in a 2D Matrix I LeetCode
- Search in a 2D Matrix II LeetCode

There is a lot to learn, Keep in mind “ Mnn boot karega k chor yrr apne se nahi yoga ya maza nahi para, Just ask 1 question “ Why I started ? “

Homework: timestamps added below

Question Links:

Do provide you feedback in the comments, we are going to make it best collectively.

Telegram Group Link: Love Babbar CODE HELP

Connect with me here:

Intro Sequence: We have bought all the required Licenses of the Audio, Video & Animation used.

Timestamps:

00:00 - Introduction
00:50 - Why we need 2-D Arrays ?
03:03 - How 2D stored in memory ?
04:22 - Promotion
05:26 - How 2D stored in memory ?
07:47 - Creating an 2D Array
09:51 - taking input in 2D Array
10:42 - Output in 2D Arrays
12:44 - Coding - Creating, Input & Output 2D Array
14:44 - Row-wise Input ion 2D Arrays
15:12 - Column-wise input in 2D Arrays
18:25 - Initialising 2D Arrays
20:45 - Linear Search in 2D Arrays
25:15 - Row-wise Sum Problem
32:22 - Largest Row Sum Problem
37:24 - Wave Print Problem
39:00 - Approach
41:00 - Code
45:22 - Time Complexity of Solution
46:20 - Spiral Print Problem
47:33 - Approach
50:45 - Code
59:17 - Time Complexity of Solution
01:00:35 - Homework
01:01:44 - Binary Search on 2D Arrays
01:02:44 - Search a 2D Matrix LeetCode Level1 Problem
01:03:55 - Approach
01:07:08 - Code
01:16:45 - Time Complexity of Solution
01:17:30 - Search a 2D Matrix LeetCode Level2 Problem
01:18:17 - Approach
01:23:29 - Code
01:28:10 - How to approach a problem ?

#DSABusted #LoveBabbar
Рекомендации по теме
Комментарии
Автор

Till now I am able to solve leet code easy and some medium problems based on binary search and sorting of arrays. It is because of your course. Thank you so much...

pratham
Автор

Ye baat "Kuch bhi skip nhi karenge dost sab kuch padha denge" ye baat hi hum logo ko biswas dilwata hai ki hum aap ke sathe mehanat karenge to manzil tak pahuch Best
Love you from West Bengal, Hooghly

suranjandhara
Автор

There are some other good courses of this level on YouTube but your way of teaching it making everything easy for students to understand makes it Class apart from others.

aayushkhurana
Автор

It took me 3 Days to Digest all the Solutions again but now I am Confident and can code similar types of Questions. Thanks So much. Onto the Next video.

mdwaqar
Автор

22:53 When passing a two-dimensional array to a function, you must specify the number of columns as a constant when you write the parameter type, so the compiler can pre-calculate the memory addresses of individual elements.

CHANDANKUMAL-dbbp
Автор

i was about to give up on this playlist .. but got the approach of binary search on 2d couple of minutes before your solution and now i am again boosted with confidence ..

krish
Автор

He is so true and genuine guy. What is more important to him is that we should understand the topic, whether we watch it from here or from somewhere else . He is a "True Guru" .

shreyaverma
Автор

Currently the best tutor in YouTube for dsa and coding thankyou sir lots of love from nepal❤❤❤

chiranjivishahi
Автор

Bhaiya itna ache se koi kese smja skta hai aur guide krskta hai sab kuch.
hats off bhaiya !!
Brilliant work!!
Loved and Enjoying your Videos

prateekkosta
Автор

I sticked until last minute. I am liking it. Let's keep the josh high🔥

vigneshv
Автор

Rotate array solution
Approach: simply transpose the matrix and then reverse that matrix
Note: Transpose: change rows into column and column into rows.
time complexity : O(N^2)

class Solution {
public:
void rotate(vector<vector<int>>& matrix) {

//tranaspose
for(int i =0; i<matrix.size();i++){
for(int j =0 ; j<i ; j++){
swap(matrix[i][j], matrix[j][i]);
}
}
//reverse
for(int i=0;i<matrix.size();i++){

reverse(matrix[i].begin(), matrix[i].end());
}

}
};

aiwithsaqi
Автор

Amazing teaching method. 2D arrays ke nam se dar lagta tha... Or upar se binary search aa jaye to behosh ho jate the but now everything seems to be peace of cake. All credit goes to Babbar Bhaiya.

Happy New year Bhaiya Ji 🙏.

JGyanRaj
Автор

Watching this series again, thanks for making this masterpiece. 🙂

AbhiRajSingh
Автор

1:01:00 the 90 degree rotation column can be easily solved by making the columns the rows. It means taking the transpose of a matrix

vallabhshelar
Автор

Bhaiya our career is dependent on your course (please make our confident level up).

techyouknow
Автор

1:02:19 He proved what he said here. I cant even imagine how a man can provide this playlist at free of cost.
thank you bhaiya i am able to solve most of the questions .

ashishashish
Автор

Bhaiya Ji sach me aapke padhaye hue playlist ki charcha har college me ho rahi lekin bhaiya ji sach bole toh abhi tak dhang se soach nahi pa rahe pryaas jari rahega )

Nikhil-xdo
Автор

bhaiya kasam se maza hi aa me abhi toh second year me hu par yeh sab solve karne me sach me bahoot maza ata hai me har bar pehle khud karta hu... aur literally abhi tak sirf ek question nhi hua tha.... aur ab toh speed bhi bahoot increase ho gayi hai...
.
.
JHOLI BHAR KE DHANYAWAD
.
I HAVE BECOME YOUR FAN....

lakshayyadav
Автор

Please do continue this consistency till the end of the cource.... because everywhere people are consistent at the beginning and not at the end... thank u

copilotcoder
Автор

Thank You bhaiya....Lga jaise khud pdh rha hu aur sab samajh aa rha ...Thank You bhaiya✨✨👑

raisanjeeb