c5

Data structure for category

旧街凉风 提交于 2019-12-20 06:07:28
问题 I am looking for a data structure to add, remove, get, and find on categories. For example: Books Drama Science fiction Other Sports Cycling Golf Team Sports Soccer Football etc. I think about using tree from the C5 collection library for example, but it looks like it has only red-black trees. Any suggestions? 回答1: You can just create a Category class that exposes a list of other Category instances. public class Category { public Category() { this.ChildCategories = new List<Category>(); }

C# Binary Trees and Dictionaries

自闭症网瘾萝莉.ら 提交于 2019-12-17 23:32:04
问题 I'm struggling with the concept of when to use binary search trees and when to use dictionaries. In my application I did a little experiment which used the C5 library TreeDictionary (which I believe is a red-black binary search tree), and the C# dictionary. The dictionary was always faster at add/find operations and also always used less memory space. For example, at 16809 <int, float> entries, the dictionary used 342 KiB whilst the tree used 723 KiB. I thought that BST's were supposed to be

Small sized collections from C5 Generic Collection Library are comparatively very slow - can anything be done?

自古美人都是妖i 提交于 2019-12-06 05:29:55
问题 I've recently been testing C5 collections in C# and I'm loving their functionality. For large collections the performance seems on par with the generic counterparts. For small collections however they are significantly slower. I suspect the dramatic deterioration in relative speed comes from constant time operations performed by C5 collections. One operation I know of is firing of events. Could this be the cause of poor performance for small collections? Can this perhaps be remedied by

Small sized collections from C5 Generic Collection Library are comparatively very slow - can anything be done?

假装没事ソ 提交于 2019-12-04 12:56:49
I've recently been testing C5 collections in C# and I'm loving their functionality. For large collections the performance seems on par with the generic counterparts. For small collections however they are significantly slower. I suspect the dramatic deterioration in relative speed comes from constant time operations performed by C5 collections. One operation I know of is firing of events. Could this be the cause of poor performance for small collections? Can this perhaps be remedied by turning some functionality off? Here' the performance test: //Two containers to be tested. 'Test' is a

Data structure for category

倾然丶 夕夏残阳落幕 提交于 2019-12-02 12:38:22
I am looking for a data structure to add, remove, get, and find on categories. For example: Books Drama Science fiction Other Sports Cycling Golf Team Sports Soccer Football etc. I think about using tree from the C5 collection library for example, but it looks like it has only red-black trees. Any suggestions? You can just create a Category class that exposes a list of other Category instances. public class Category { public Category() { this.ChildCategories = new List<Category>(); } public string Name { get; set; } public IList<Category> ChildCategories { get; private set; } } A tree would be

Implementing Hoey Shamos algorithm with C#

情到浓时终转凉″ 提交于 2019-11-26 06:46:26
问题 Okay, I am now getting the correct information from my current algorithm! However, with 700,000 polygons to check, it\'s just way too slow! The previous issue is fixed (My Line2D intersectsWith method was incorrect) Now it\'s a matter of identifying my bottleneck! This algorithm is suppose to be O(nlog-n) so it should be much quicker. My intersectsWith method looks like it can\'t get any faster, however I will post its code, in case I\'m wrong EDIT: Added IComparable interface My method for