Very large data structure needed. Looking for ideas
By : Khanh Ho
Date : March 29 2020, 07:55 AM
this one helps. I have been chewing on this for a while and I thought I would open a question up and try to get some ideas about it. Maybe something will spark a light bulb. , The basic structure per hexagon is: code :
* hex color (with outline obviously) (or a bitmap picture) blitting anyone!
* TextField with a number in it. (max 2 digits)
|
Data structure needed
By : user3623325
Date : March 29 2020, 07:55 AM
hope this fix your issue It needs to be some sort of sorted, balanced tree. It is not likely that any tree will be significantly better suited for the minimum deletion, as it will still require re-balancing anyway. All of the operations you ask for will be O(log(n)). Red-black trees are readily available in C++ and Java.
|
Unable to figure out the correct data structure and correct approach in this scenario of parsing text
By : user2523468
Date : March 29 2020, 07:55 AM
Hope this helps If each page has its own Map >, then never have more than one thread processing a single page - then you won't need to synchronize access to the Map or use a concurrent Map implementation. You can statically partition the pages among your workers as JB Nizet suggests in the comments; another option would be to place all pages in a ConcurrentLinkedQueue and have the workers poll the queue for pages to parse, terminating when the queue is empty (poll returns null). Either way, you'll only need one ExecutorService, since each worker is responsible for both parsing and map population.
|
explain the logic behind the structure of code needed to account for extra spaces, in order to calculate the correct ave
By : konood
Date : March 29 2020, 07:55 AM
|
How can we understand what data structure is needed?
By : Brett Marovec
Date : March 29 2020, 07:55 AM
Does that help There's no rule of thumb. For your particular problem a completely new data structure might be needed. This often happens in AI problems, which is why Lisp was such a handy language because it was easy to construct new data structures from lists. (or actually s-expressions, which are equivalent to trees). But most problems you encounter in the working world are much more mundane, and can easily be solved with a standard data structure. After a while you begin to associate certain problems with certain solutions (get something fast? a hash table. get something fast but also have some ordering requirements? a tree) and can decompose a more complex problem into simpler components that can be solved with these type of standard data structures.
|