Hi Please tell us that in which situation or circumstances can use conventional data structure in ios development , like when can we use link list, trees
One of my favourite examples is an app that contains a search screen. Letβs take a To-Do app as an example. If you want to power prefix matching for your search through your saved entries, a Trie tree is a great data structure to use.
A game employing the mechanics of the Josephus problem might use Linked Lists as a model for the deletion algorithm.
IMO, the biggest benefit of data structures is that each data structure tackles a very well defined problem. This reinforces the idea of encapsulation in OOP and reduces the chance for bugs in situations where you need them.
For example, if you wanted to create a queuing mechanism for your app, you could just use a plain array and interact with it as a queue. Itβll be inherently dangerous to do so though, since the array is exposed for modifications. Creating a Queue
type that only exposes the queue related methods will guard against unwanted modifications.