|
Unordered Array |
Ordered array |
Search |
Comparison times O (N) |
Comparison times O (logn) <-Binary Search |
Insert |
O (1) |
Comparison times O (N) |
|
|
Number of moves maxo (N) |
Delete |
Comparison times O (N) |
Comparison times O (logn) |
|
Number of moves maxo (N) |
Number of moves maxo (N) |
Bytes ---------------------------------------------------------------------------------------------------
Conclusion
Ordered arrays are useful when queries are frequent and insertion or deletion is frequent and cannot work efficiently.
Unordered arrays cannot work efficiently when they are inserted frequently.
Array Defects
After being created, the size and size are fixed. When the program starts designing, you do not know how many data items will be put into the array.
Bytes ---------------------------------------------------------------------------------------------------
Efficiency Comparison-array