Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Open is the index of the "deepest" '(' parenthesis and Close is the index of "deepest" ')'. I thought that recursion is easier to understand but a loop would be faster right?
@Incomputable Hello, I tried using the C++ way with iterators. Is it ok? At the moment I am learning new algorithms and I was wondering if is it ok to code like this or should I write them using both ways. The standard library is doing the job for me which is not necessarily good when learning how stuff works behind the scenes. Could you recommend me a book on the new C++? Thanks.
Thank you for the advice. I will try in the future to use the C++ way. Should I stop using normal arrays? Are the iterators the way to go when writing such algorithms? Is there any speed difference?