## Data Structures and Algorithms

Download QuadTreeOptimization.zip c# project Background Today I'd like to share with you interesting experiences I made last several evenings when working on one of my open source hobby projects - Source Code Cloud Generator http://sourcecodecloud.code... One of the tasks was arranging of nonintersecting rectangles on a 2D surface in certain pattern. For quick 2D collision detection (rectangle intersection) I decided to use QuadTree data structure [see: http://en.wikipedia.org/wik... ......

Why .NET LinkedList does not support Concat and Split operations? Download SimpleLinkedList source code Concat O(1) or O(n) ? The .NET LinkedList is a circular doubly linked list, where each node holds a reference to its previous and next nodes. The last node’s next is the head node and the head node’s previous is the last one. Linked lists are attractive because of O(1) insertion and removal operations. Instead of shifting elements in array you just chain nodes in appropriate order and that’s it. ......

As an informatics student you learn hundreds of mathematical definitions and theorems and all of them seem to be useless programming. Here the evidence from the “real programmer life” to demonstrate you that’s not true. I was asked to analyze some very strange behaving class. The Contains(object obj) method was not working correctly on after populating the list with instances of this class. The problem was a mess implementation of bool Equals(Object obj) overloaded methods. There was no logical or ......

Back to the roots: .NET binary search and the meaning of the negative number of the Array.BinarySearch() return value Recently I gave a group of developers a task witch can be simplified to following simple problem: you have a sorted array of elements; find the index of a given element in this array. They came up with following solution: //given array int[] sortedArray = new[] { 1, 5, 8, 12, 18, 20 }; //Create a list from the array List<int> list = new List<int>(sortedArray); //use IndexOf ......