Category "algorithm"

What string similarity algorithms are there?

I need to compare 2 strings and calculate their similarity, to filter down a list of the most similar strings. e.g. searching for "dog" would return dog doggone

Optimizing Fixed-Point Sqrt

I made what I think is a good fixed-point square root algorithm: template<int64_t M, int64_t P> typename enable_if<M + P == 32, FixedPoint<M, P>

Can we construct a BST from a pre-order traversal simply by inserting the elements in preorder traversal in sequence into an empty tree?

Given a preorder traversal of a BST.I have to construct the BST. Can I construct the BST from the preorder traversal simply by creating a empty BST and then ins

Longest path on a grid, without revisiting grid cells

I am looking for an algorithm to fidn the longest path between two points on a grid, with the added restriction that you cannot revisit a cell on the grid. (Als

Can hash tables really be O(1)?

It seems to be common knowledge that hash tables can achieve O(1), but that has never made sense to me. Can someone please explain it? Here are two situations

Can hash tables really be O(1)?

It seems to be common knowledge that hash tables can achieve O(1), but that has never made sense to me. Can someone please explain it? Here are two situations