dynamic sorted array data structure in C programming language