[1] Find a linear (O(n) in time) algorithm which does in-place
riffle shuffle of an array of size 2n.
[2] Write a program to check for balanced brackets (and braces, and parentheses)
without using a stack.
"{[]()" false.
"{[]()}" true.
")))(((" false
"((()))" true
"{}([]())" true
"[(]){}" false
Use O(n) time and O(1) space.
Amazon
Saturday, February 2, 2008
Algorithm interview questions
Posted by
innersmile
at
8:59 PM
0
comments
Subscribe to:
Posts (Atom)