eladgl/TwoHeapsDataStructure
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
/* * A Code Made By Elad Goldenberg *This is a data structure for the following constraints: *___________________________________________________________ *|Func Name | Details | *|----------------------------------------------------------| *|Init(S) |For a Given array A with len(A)=m, | *| |initialize the structure at O(m). | *|----------------------------------------------------------| *|Insert(x) |Adding x to the data structure at O(log(n)) | *| |as n is the current number of elements | *|----------------------------------------------------------| *|Find-Min |Return minimum at O(1) | *|----------------------------------------------------------| *|Find-Max |Returen maximum at O(1) | *|----------------------------------------------------------| *|Del-Min |Deleting minimum from structure at O(log(n))| *|----------------------------------------------------------| *|Del-Max |Deleting maxmimum from structur at O(log(n))| *------------------------------------------------------------ *All the above are time complexity requirements */