language agnostic - The data structure for the "order" property of an object in a list -


I have a list of the order object stored in the database and through an ORM (specifically, the OSM of the DJ) has reached. This list is sorted voluntarily by the user and I need some ways to keep track of this. Each object has an "order" property for that object, which specifies its order in relation to other objects.

Any data structure that you use to sort on this order field will need to be recreated on request, then the creation should be cheaper. I often compare between several objects. I and the inclusion I have in every database One line can not be needed to update

Which data structure should I use?

piles

as compared to price Has been implemented with std :: set ( c ++ ) (such as value stored), for example integer by value, string by string sequence and so on. Good for order and access, but it is not certain that you need to revisit it, that during the inclusion, continuous and much more

You are not specifying what you have other obstacles. If the number of elements knows and is appropriate or possible to keep a certain array in memory, then each position will be specified by the index and assumes a fixed number of fixed elements.

You do not specify that you want to do what you want you often do, if you load prices, then once again you can use them without modification, then you can create You can either use an algorithm that can create indexes or use fast access to change the storage ...


Comments

Popular posts from this blog

c++ - Linux and clipboard -

Visual Studio 2005: How to speed up builds when a VSMDI is open? -

booting ubuntu from usb using virtualbox -