educative.io

Two Pointers: Introduction - Grokking Coding Interview Patterns in Java

Two Pointers: Introduction?

Can someone explain me what this statement means with an example?

  • The problem requires an exhaustive search of the solution space, that is, eliminating one solution does not eliminate any others.

Thanks

1 Like

Hello @Sai_Teja,

In problems requiring an exhaustive search of the solution space, such as the “Memory management” example, each potential solution must be thoroughly examined. This means that you cannot dismiss or eliminate a solution based on certain criteria and expect it to simplify the search for other solutions. Each solution is unique and needs individual consideration.

If you eliminate one memory block as a potential solution (e.g., due to size constraints), it doesn’t provide any information about the suitability of other memory blocks. The exhaustive search involves considering each memory block individually.

I hope this adds more clarification to the meaning of the statement that you’re asking about. Please share any more suggestions and feedbacks, we’d be happy to help. Thanks!

Happy learning!