All Questions
Tagged with matrix complexity
10 questions
13
votes
5
answers
2k
views
solve n*m matrix processing in less time
I want to solve a problem in less time complexity. Here are the details:
Given an n*m matrix, n rows and m columns. Initially, the matrix is empty filled with 0s.
...
1
vote
1
answer
126
views
Binary search of 2D matrix
I have written code as below:
...
5
votes
1
answer
137
views
Closest Pair heuristics, graph with adjacency matrix in C++17
I was trying to solve a problem that was briefly mentioned at the beginning of the "The Algorithm Design Manual" by Steven Skiena (Ch 1, Problem 26).
It took me some time to build a working ...
3
votes
1
answer
523
views
Using Python to search a sorted 2D Matrix
Code
Problem
...
2
votes
3
answers
167
views
Modeling, view and projection transformation using vector and point in homogenous form
I know this is horrible code. This program is for performing modeling, view and projection transformation.
The program reads input from scene.txt and outputs the <...
1
vote
1
answer
1k
views
Rotate matrix clockWise and counter clockWise
This code is a mix of the same question one time rotating to the right and one time to the left.
I tried to simplify the code since I'm struggling with all of the indexing here.
https://leetcode.com/...
4
votes
1
answer
106
views
Make each element equal to its neighbouring element which is maximum in a matrix
I have a matrix and I want to make each of its element equal to the maximum of its neighbouring element and each time I increase number of counts till all the elements in the matrix becomes equal to ...
2
votes
2
answers
3k
views
'Zero out' a matrix using Python
Below is my code for an attempted solution to cracking the coding interview exercise 1.8 written in python 3.5. The problem statement is:
Write an algorithm such that if an element in an MxN matrix ...
9
votes
1
answer
15k
views
Rotate Matrix using Python
This is my solution to Exercise 1.7 from Cracking the Coding Interview. I would appreciate any feedback on coding style and algorithm efficiency.
I do know that there is an existing function in ...
2
votes
1
answer
232
views
Given set of cubes can we get a given word?
Given some cubes, can cubes be arranged such that an input word can be formed from the top view of the cubes?
For example: assume an imaginary cube with only 3 surfaces where ...