4 votes

A* algorithm implementation in modern C++

As I understand your code, a new node is pushed for every unvisited neighbour of the node that is visited. A result of that is that the queue will contain, in many cases, duplicate nodes, or "...
harold's user avatar
  • 8,044
4 votes

A* algorithm implementation in modern C++

Missing and redundant const Make sure that all pointer and reference parameters that point to data that should not be modified are passed as ...
G. Sliepen's user avatar
  • 45.1k
4 votes

C++ Eigen/Mex function to perform two pagewise convolutions on a 3D matrix with a simple kernel

This is a great question in most respects, but since the code sample doesn’t compile and can’t be tested, I can only give you a vague and speculative answer. I’ll skip over your Item 1, because I have ...
Davislor's user avatar
  • 4,529
2 votes

Merge a list of deeply nested HashMaps

any other approach ... that could help me squeeze a bit more performance ? Choose a nice output format for your maps, and serialize each one to a text file (or to an RDBMS). For example the original <...
J_H's user avatar
  • 10.8k
2 votes

Find all permutations of string using recursion

It's fine to reinvent the wheel. Overheated comments to the contrary, it's perfectly fine to use classic algorithms as a vehicle to practice your coding skills. Just be aware, if you didn't know ...
FMc's user avatar
  • 11.8k
1 vote

Merge a list of deeply nested HashMaps

You present uncommented code. While I might succeed figuring out what mergeMaps() achieves, it may be intended to do something slightly different: Document you ...
greybeard's user avatar
  • 5,509

Only top scored, non community-wiki answers of a minimum length are eligible