All Questions
9 questions
3
votes
1
answer
219
views
generate combinations from list of numbers
generate all combinations from list of numbers,the combinations can be pair of two numbers
example 1 : list of 2 numbers [1,2]
[
[[1],[2]],
[[1,2]]
]
example 2 : ...
6
votes
1
answer
149
views
Approximation search source reconstruction localization algorithm
Goal
To determine the coordinates of some signal source in a 3D space, given the coordinates of four observers and the time at which each saw the signal, as well as the velocity of the signal.
...
7
votes
2
answers
6k
views
Permutations with replacement in Python
Many a times, I've had the need to use a permutations with replacement function.
So, I've written a function to do just that:
...
9
votes
1
answer
210
views
Tower of Hanoi with helper function
Here is my solution to the Tower of Hanoi problem using Python
...
2
votes
1
answer
785
views
Finding peak point in an array by using divide and conquer approach
It is to find the maximum element in an array which is first increasing and then decreasing. I've tried to write my idea by using divide and conquer approach. Is there any improvable or missing point? ...
3
votes
1
answer
2k
views
Pouring water between two jugs to get a certain amount in one of the jugs (2)
I have been practicing recursion lately and I came up with this code to solve the water jug problem, given two jugs of volume jug1 and ...
12
votes
2
answers
2k
views
Tower of Hanoi Recursive Implementation using Python with OOP
I have just finished a small program for Tower of Hanoi using recursion. I did it to practice OOP which I recently learnt. It took me about 2 hours to research about the recursive algorithm and write ...
4
votes
1
answer
2k
views
Word Squares Generator
I've solved the Word Squares problem:
Given a set of words (without duplicates), find all word squares you can build from them.
A sequence of words forms a valid word square if the kth row and ...
6
votes
1
answer
3k
views
Longest common subsequence length and backtracking the string
Problem: Given two sequences, print the longest subsequence present in both of them. A subsequence is a sequence that appears in the same relative order, but not necessarily contiguous. For example, “...