Member Avatar for stinkypete

I have a C++ application that I want to make more flexible and user-friendly. It currently contains seven nested for-loops, and part of the new flexibility is that this number will become variable (between two and twenty, say). What is the easiest way to achieve this?

Recommended Answers

All 2 Replies

Redesign the algorithm, there must exist better algorithm than order of O(n^20).

Sounds like a possible use of recursion, depending on how similar each layer of the looping is.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.