PRINT ELEMENTS IN SORTED ORDER USING ROW AND COLUMN WISE SORTED MATRIX|MATRIX|FINAL 450|LOVE BABBAR
Вставка
- Опубліковано 6 вер 2024
- PRINT ELEMENTS IN SORTED ORDER USING ROW AND COLUMN WISE SORTED MATRIX
SOL 1. Putting the values of matrix in a vector and sort them.
SOL 2. Using priority_queue.
Your support can make a big difference in my content creation journey and help me in making the educational content like this....
UPI ID: anilkumarsingh0160@okaxis
BIT MANIPULATION PLAYLIST, Please do check it out :- • BIT MANIPULATION || FI...
MATRIX PLAYLIST, Please do check it out : - • MATRIX || 2D ARRAY || ...
#data_structures
#matrix
#final450
#loveBabbar
#null
Thanks for explainatiomn bro !
Keep On doing Good works....
We will support
Thank you very much, please do check out my bit manipulation and matrix playlist......
dost you explained 1st solution with complexity N^2log(N^2)--> as array contain N^2 element so sorting took that much complexity. Then again you explained the same logic bt instead of doing sorting explicitly took minHeap bt still the min heap will have n^2 elements so sol2 will also have n2log(n2) complexity.
Yaa both the solutions will have the same time complexity of N^2Log(N)
your code is giving run time error and segmentation fault on geeks for geeks
Try,
Code 1 : -
vector sortedMatrix(int N, vector Mat) {
vectorv;
int k=0;
for(int i=0;i
@@nullpoint001 Thanks now code is passing all test cases.
Pdh lo fir padhana