100% fastest in C
\ntypedef struct {\n    int ptr;\n    int size;\n    char** value;\n} OrderedStream;\n\n\nOrderedStream* orderedStreamCreate(int n) {\n    OrderedStream *ordere
```\ntypedef struct {\n    int ptr;\n    int size;\n    char** value;\n} OrderedStream;\n\n\nOrderedStream* orderedStreamCreate(int n) {\n    OrderedStream *orderedStream = (OrderedStream*)malloc(sizeof(OrderedStream));\n    orderedStream->ptr=1;\n    orderedStream->size=n;\n    orderedStream->value=(char**)malloc(sizeof(char*)*n);\n    for(int i=0;i<n; i++){\n        *(orderedStream->value+i)=NULL;\n    }\n    return orderedStream;\n}\n\nchar ** orderedStreamInsert(OrderedStream* obj, int id, char * value, int* retSize) {\n    *(obj->value+id-1)=value;\n    int count=0;\n    if(id==obj->ptr){\n        while(id-1+count<obj->size&&*(obj->value+id-1+count)!=NULL)\n            count++;\n        obj->ptr=id+count;\n    }\n    *retSize=count;\n    return obj->value+id-1;\n}\n\nvoid orderedStreamFree(OrderedStream* obj) {\n    free(obj->value);\n    free(obj);\n}\n```
[]