update Queue and Stack