Algorithm To Insert Item In A Data Structure