0

I need a way to implement a fast lookup algorithm / system to find users very quickly in a multi-level department and multi-level employee/manager relation organization structure.

Departments can have any level of departments and users directly connected to departments. User are connected to departments and other users at the same time.

What would be the best approach to implement such a system? There will be approximately 2000 users and 30 departments. Is there a good way to hold all of this information on memory?

0

3 Answers 3

1

I'm more than sure that on this scale (2000 users) pretty much any data structure that allows sequential access will do just fine (provided everyting's in memory, of course). What's even more, do you really need to invent complex lookup structure where a simple list will suffice?

Make It Work Make It Right Make It Fast

1

find users very quickly

This sounds like a tree structure.

Something like this:

class Department List<Department> ChildDepartments List<User> Users class User List<User> Childusers 

This should be fine if you want to list all users of a department.

0

Dictionaries are in general what provide the fastest access. See this link on SO: https://stackoverflow.com/questions/128636/net-data-structures-arraylist-list-hashtable-dictionary-sortedlist-sortedd

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.