1.

What could be the tradeoff between the usage of an unordered array versus the usage of an ordered array?

Answer»
  • The main ADVANTAGE of having an ordered array is the reduced search TIME complexity of O(log n) whereas the time complexity in an unordered array is O(n).
  • The main drawback of the ordered array is its increased insertion time which is O(n) due to the fact that its element has to reordered to maintain the order of array during EVERY insertion whereas the time complexity in the unordered array is only O(1).
  • CONSIDERING the above 2 key points and depending on what KIND of scenario a developer requires, the appropriate data structure can be used for implementation.


Discussion

No Comment Found