Quote:Describe this algorithm in C++
Er ... no.
Why not? Because as Patrice has said, that is unreadable. Partly it's the lack of indentation he mentioned, partly it's the single character names for all variables, partly it's the complete lack of any documentation.
But mostly it's because all of those things combine to make code I don't even want to look at, much less try to understand, or work out if it does what it should, and if so what the heck that actually was.
You want people to read your code? Make it readable.
Indent it correctly.
Use sensible variable names that describe what the variable is used for.
Comment code where it's not obvious why you are doing something, so that it explains why - not what it's doing, but why it's doing it.
And that includes you: when you come back to this in a few months time you will go "WTF?" and have no idea what it does - or any interest in finding out ...