here is another dynamic programming question (Vazirani ch6) Consider the following 3-PARTITION problem. Given integers a1...an, we want to determine whether it
Trying to merge 3 arrays into one so that the final array is in order. Given int[] a = {1,3}; int[] b = {2,4}; int[] c = {1,5}; Merge the arrays so that t
I need an efficent algorithm to do math::power function between two floats, do you have any idea how to do this, (i need the algorithm not to use the function
I have perused a lot of code on this topic, but most of them produce the numbers that are prime all the way up to the input number. However, I need code which
I am totally new to python and I am trying to implement quicksort in it. Could someone please help me complete my code? I do not know how to concatenate the th
For a polygon defined as a sequence of (x,y) points, how can I detect whether it is complex or not? A complex polygon has intersections with itself, as shown:
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
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>
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
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
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
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