Write queue and stack using resizing array