2D Arrays Practice | Matrix Transpose & Rotation, Pascal's Triangle | Lecture 21 | Java & DSA Course

preview_player
Показать описание
The best way to ace programming is by solving problems. This lecture is a continuation of the previous lecture where we discussed in depth about Multi-dimensional arrays. In this lecture, we will solve some important questions related to 2-D Arrays. We will first understand the approach to solve the problem, then implement the algorithm in our code, and finally will have a quick dry run so there won't be any confusion in the algorithm or the code.

If you are facing any trouble accessing the assignment or lesson plan, please re-login to your account on PW Skills website and try.

Are you finding the classes helpful?
Stay tuned for more!

Access the notes and assignments for this class for free at:

Timestamps
00:00 = Intro
00:37 = Recap
03:38 = Today's checklist
04:02 = Problem 01 : Transpose of matrix
08:03 = Problem 01 : Transpose of matrix code
13:00 = Problem 01 : Transpose of matrix dry run
18:00 = Problem 02 : Transpose of matrix inplace
20:14 = Problem 02 : Transpose of matrix inplace - Testing swap code
22:30 = Problem 02 : Transpose of matrix inplace logic
30:51 = Problem 02 : Transpose of matrix inplace - final code
31:50 = Non-square matrix condition
32:45 = Problem 02 : Transpose of matrix inplace dry run
34:49 = Problem 03 : Rotate a matrix 90 degrees clockwise
38:50 = Problem 03 : Rotate a matrix 90 degrees clockwise code
45:34 = Problem 04 : Return n rows of Pascal's triangle
52:13 = Problem 04 : Return n rows of Pascal's triangle code
59:15 = Problem 04 : Return n rows of Pascal's triangle dry run
01:05:00 = Summary
01:07:26 = About next lecture

If you are joining us late, to know more about PWSkills & plans :

▶️ PW Skills LinkedIn Channel -

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

noted point :- rotating an 2d array by 90 clockwise === first take transpose then reverse each row.

Raj
Автор

I have learnt from many DSA teachers . Some of them are best in market but mam you are on the another level, easiest explaination ever. Thank You for you blessing. Thank You PW .

piyushgupta
Автор

lecture aisa banao ki 4 din kya 4 janmo tak ARRAY yaad rahe ❤❤❤❤❤❤😍😍😍😍

itshurtyr
Автор

thanks for good question practice and building our logic 👌

omkarmatte
Автор

You want to Learn DSA
Best place and free
Thank you all CW
Team ❤

BaapDeveloper
Автор

For pascal question:
static int[][] pascal(int n){
int[][] pascal = new int[n][n];
for(int i=0;i<n;i++){
pascal[i][0] = 1;
for(int j=1;j<i+1;j++){
pascal[i][j] = pascal[i-1][j] + pascal[i-1][j-1];
}
}
return pascal;
}

vaibhav
Автор

solutution reverse rows-
static void reverse(int [][]arr, int r, int c ){
int temp;
for(int i=0;i<r;i++){
for(int p1=0, p2=c-1 ; p1<=p2 ; p1++, p2--)
{
temp= arr[i][p1];
arr[i][p1]=arr[i][p2];
arr[i][p2]=temp;
}
}
PrintArrays(arr);
}
Thank You So Much Mam, Aap Bahut Accha DSA Padhate Ho Ek Ek Qu Clear Ho jata Hain Mind Me

Deeptiharshkla
Автор

for rotation of an array by 90 degree, simply use this loop instead of transpose and reverse.
for(int j=0;j<n;j++){
for(int i=m-1;i>=0;i--){
System.out.print(a[i][j]+" ");
}}

sharadsharma
Автор

one thing to add the method of caculating the inplace transpose is only effective when the number of rows and columns are same hence better to go with using extra space

VikasGupta-oklh
Автор

pascal ko kitna aasani se samjhaya thanku mam

SahilAnsari-hr
Автор

please upload assignment of 2d array and its solution

anshu_shree
Автор

mam notes wali website nahi open ho rahi hai

kailashrabari
Автор

i request to the the team of @College Wallah please provide this video download for 480P. i hope you will solve this problem as soon as possible.

educationtreebysarbjotsing
Автор

LINK TO NOTES ANS ASSIGNMETNS IS NOT WORKING !!!! LECTURE IS GREAT

sagarchawla
Автор

Placement ke liye aptitude ka bhi course start karaya jaye

mhtsingh
Автор

Mam one request pleasure aap jb bhi new question le to new file bnaye jyada code ek file me thoda kam smjh aata h
Vese you are a great teacher 🥰

jeetukumar
Автор

Mam notes and assignment link is not opening.

adityaghatiya
Автор

I just want to know about this course, how this teacher is teaching I have java in my 4th sem so can i teach from here for better understanding

vanshgangwar
Автор

Jaisa aapne pda rakha hain na mam aisa koi pda nahi sakta thanks mam

shyamlalbhardwaj
Автор

hi there am unable to find the assignements and the notes can anyone help

rvstech
visit shbcf.ru