Live data from Hacker News

Problem Solving with Algorithms and Data Structures

interactivepython.org

1–10 of 17 posts

Re: Problem Solving with Algorithms and Data Structures

#7
post #3

I still can't understand why, once they have a free version available in form of a html page, they don't give also a free pdf version far more readable and portable.

The book has exercises that you can type out, execute and debug in the pages itself.

Re: Problem Solving with Algorithms and Data Structures

#8
We've had a couple of virtual study group Google Hangout meetings about this book at CodeBuddies -- http://hangouts.codebuddies.org/category/data-structures-and...

IMO this is one of those books where it helps to talk about the material out loud/screenshare. The material can sometimes be dense.

Re: Problem Solving with Algorithms and Data Structures

#10
post #9

The "Simple Balanced Parentheses" problem solution does not have to use a stack one index for opening(+1) and closing(-1) parentheses should be enough. Or am I wrong?!

I believe you are correct. Instead of using a stack, you can add one for opening, subtract one for closing and as long as your count is non-negative, it will work the same way. Its effectively the same algorithm, except instead of actually keeping the stack, you're keeping track of the number of objects in the stack, and it'll reduce your worst case space requirement from linear in the number of parentheses to logarithmic.
Post reply on HN