Search:

Type: Posts; User: helloworld922

Search: Search took 0.08 seconds.

  1. Re: balancedBracketsByCounting (String s) that checks brackets are matched in the Str

    One way I find very effective for writing algorithms is to use a state-machine diagram. It's basically a flow-chart, and provides the states (i.e. what to do) as circles, then arrows of...
  2. Re: balancedBracketsByCounting (String s) that checks brackets are matched in the Str

    From a quick scan-through it looks like it works. Have you tested it thoroughly? Designing a good test structure is as important if not more important than the actual program itself. Try running it...
  3. Re: balancedBracketsByCounting (String s) that checks brackets are matched in the Str

    The easiest way to do this is with a stack. Every time you see an opening brace/parenthesis/etc. push it onto the stack. Whenever you see a closing brace/parenthesis/etc. see if the item at the top...
Results 1 to 3 of 3