Skip to main content

All Questions

Filter by
Sorted by
Tagged with
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 : ...
Gurmessa Lemma's user avatar
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. ...
10GeV's user avatar
  • 305
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: ...
Sriv's user avatar
  • 2,800
9 votes
1 answer
210 views

Tower of Hanoi with helper function

Here is my solution to the Tower of Hanoi problem using Python ...
MrJoe's user avatar
  • 2,143
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? ...
Soner from The Ottoman Empire's user avatar
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 ...
d_darric's user avatar
  • 163
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 ...
Oliver H's user avatar
  • 123
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 ...
m0meni's user avatar
  • 382
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, “...
arshovon's user avatar
  • 205