Since users will expect a bulk insert to be faster than individual inserts, a better algorithm should be used here. For example: copy the data into a temporary array, sort this array, and then merge with the original data in order (likein merge sort). The `insert()` function could also get an optional parameter flag that indicates if the data to be inserted is already sorted.