basic algorithms on arrays, strings,, trees and graphs