C-Sharp-Algorithms
C-Sharp-Algorithms copied to clipboard
Basic optimizations for UndirectedSparseGraph
Description
Optimized item removal from UndirectedSparseGraph by only trying to remove the given item from its neighbors' adjacency lists, instead of all vertices'.
Optimized the Contains function of the DLinkedList structure by avoiding exceptions entirely, as they are costly and not really meaningful in this case (not finding an item in a list is normal, it's not an exception).
Checklist
- [ ] An issue was first created before opening this pull request
- [ ] The new code follows the contribution guidelines
- [X] I have performed a self-review of my own code
- [X] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [X] My changes generate no new warnings
- [ ] I have added tests to ensure that prove my fix is effective or that my feature works
- [X] New and existing unit tests pass locally with my changes
Hi @melon3r, pull requests should follow from existing issues, can you please create one first describing what kind of problem you're solving?
Hi @aalhour, I just created #146