Hey im just wondering what would be the best collection to use when creating a store for employee details such as name, age address, dob, wages and email address. the store needs all the bare essentials such as add, edit, remove, remove all and searchBy.
Share
Well you’d probably want a fast search, so a hashing structure with the key as the fiend you want to search by could be the best solution. For example, if you want to search by name, you can create a class like this:
and implement the required methods based on your needs using the
employeesdata structure. If the search is done by name you can have the name as the key string.Unfortunately, searching by a different field than the index will require a linear search which will be slow if you have a huge number of entries.