Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
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. ...
CodeCrusader's user avatar
1 vote
1 answer
126 views

Binary search of 2D matrix

I have written code as below: ...
Szyszka947's user avatar
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 ...
Mikhail Kalashnikov's user avatar
3 votes
1 answer
523 views

Using Python to search a sorted 2D Matrix

Code Problem ...
matta's user avatar
  • 31
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 <...
afsara__'s user avatar
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/...
Gilad's user avatar
  • 5,373
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 ...
Alfran's user avatar
  • 141
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 ...
Average's user avatar
  • 851
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 ...
Average's user avatar
  • 851
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 ...
JavaDeveloper's user avatar