final version linear probing with dynamic resizing