background preloader

Data Structures and Algorithms with Object-Oriented Design Patterns in C#

Data Structures and Algorithms with Object-Oriented Design Patterns in C#
Related:  Data Structures

Data Structures and Algorithms: Table of Contents Data Structures and Algorithms John Morris, Electrical and Electronic Engineering, University of Western Australia These notes were prepared for the Programming Languages and System Design course in the BE(Information Technology) course at the University of Western Australia. The course covers: Algorithm Complexity Polynomial and Intractible Algorithms Classes of Efficient Algorithms Divide and Conquer Dynamic Greedy Searching Lists Trees Binary Red-Black AVL B-trees and other m-way trees Optimal Binary Search Trees Hash Tables Queues Heaps and Priority Queues Sorting Quick Heap Bin and Radix Graphs Minimum Spanning Tree Dijkstra's Algorithm Huffman Encoding Fast Fourier Transforms Matrix Chain Multiplication Intractible Problems Alpha-Beta search The algorithm animations were mainly written by Woi Ang with contributions by Chien-Wei Tan, Mervyn Ng, Anita Lee and John Morris. © John Morris, 1998

Contributions to Entity framework community - Zeeshan Hirani If you had been reading my blog, you must be wondering where did he go after publishing such awesome blog entries(jk). I had gotten lot of good feed back on the examples I had done on linq to SQL but like all good things must come to an end so did linq to SQL for me. My company was committed in moving forward with EF so I decided to move forward with Entity framework as well. During the process I learned so much stuff and felt the pain most developers went through with this technology. No doubt EF has a learning curve like any other technology but mapping scenarios offered by EF are simply great. May be the reader base can get the same perception about EF and the mapping scenarios it offers even in version 1 as I did, after reading the PDF that contains 500 pages of content about entity framework. Below is a link to the PDF document that contains examples of various mapping scenarios and concepts that I have learned about entity framework Entity Framework learning guide Update 6/14/2010

VisuAlgo - Sorting (Bubble, Selection, Insertion, Merge, Quick, Counting, Radix) VisuAlgo was conceptualised in 2011 by Dr Steven Halim as a tool to help his students better understand data structures and algorithms, by allowing them to learn the basics on their own and at their own pace. VisuAlgo contains many advanced algorithms that are discussed in Dr Steven Halim's book ('Competitive Programming', co-authored with his brother Dr Felix Halim) and beyond. Today, some of these advanced algorithms visualization/animation can only be found in VisuAlgo. Though specifically designed for NUS students taking various data structure and algorithm classes (e.g. CS1010, CS1020, CS2010, CS2020, CS3230, and CS3233), as advocators of online learning, we hope that curious minds around the world will find these visualisations useful too. VisuAlgo is not designed to work well on small touch screens (e.g. smartphones) from the outset due to the need to cater for many complex algorithm visualizations that require lots of pixels and click-and-drag gestures for interaction.

Binary search algorithm In computer science, a binary search or half-interval search algorithm finds the position of a specified input value (the search "key") within an array sorted by key value.[1][2] For binary search, the array should be arranged in ascending or descending order. In each step, the algorithm compares the search key value with the key value of the middle element of the array. If the keys match, then a matching element has been found and its index, or position, is returned. Otherwise, if the search key is less than the middle element's key, then the algorithm repeats its action on the sub-array to the left of the middle element or, if the search key is greater, on the sub-array to the right. A binary search halves the number of items to check with each iteration, so locating an item (or determining its absence) takes logarithmic time. Overview[edit] Searching a sorted collection is a common task. Examples[edit] Example: The list to be searched: L = 1 3 4 6 8 9 11. Compare X to 6. .

The Selection Sort The selection sort improves on the bubble sort by making only one exchange for every pass through the list. In order to do this, a selection sort looks for the largest value as it makes a pass and, after completing the pass, places it in the proper location. As with a bubble sort, after the first pass, the largest item is in the correct place. Figure 3 shows the entire sorting process. Figure 3: selectionSort Selection Sort (lst_selectionsortcode) You may see that the selection sort makes the same number of comparisons as the bubble sort and is therefore also . Self Check Q-22: Suppose you have the following list of numbers to sort: [11, 7, 12, 14, 19, 1, 6, 18, 8, 20] which list represents the partially sorted list after three complete passes of selection sort?

Sorting – topcoder By timmac — TopCoder MemberDiscuss this article in the forums Introduction Any number of practical applications in computing require things to be in order. Even before we start computing, the importance of sorting is drilled into us. From group pictures that require the tallest people to stand in the back, to the highest grossing salesman getting the largest Christmas bonus, the need to put things smallest to largest or first to last cannot be underestimated. When we query a database, and append an ORDER BY clause, we are sorting. General Considerations Imagine taking a group of people, giving them each a deck of cards that has been shuffled, and requesting that they sort the cards in ascending rank order. When comparing various sorting algorithms, there are several things to consider. A second consideration is memory space. A third consideration is stability. Bubble Sort One of the first sorting algorithms that is taught to students is bubble sort. Insertion Sort Merge Sort Heap Sort

Related: