Tangled cable: Let's have a long cable, from both ends of which protrudes n wires. Each wire at the left end is connected to just one at the other end and we want to find out which one. To do this, we can use the following operations: (1) apply voltage to a given wire at the left end, (2) disconnect voltage from a given wire at the left end, (3) measure the voltage at a given wire at the right end. What is the best algorithm that uses these operations to find out what is connected to what. Could it be done with the divide and conquer method? In what time complexity? The only solution I could figure out is to check each cable with each cable until we find match and then repeat with next cable.