Posts

Showing posts from 2016

Selection Sort Algorithm

Is a linear sort algorithm which focus on moving through an array and put in each position the smaller corresponding element in the same array. The Selection Sort Algorithm run the array's elements from its first to the last and for earch position  look in their next elements a smaller value than the current and if is found then make a switch of values in the two the position. It has O n2 time complexity which make it inefficient on large lists. Generally performs better than bubble and worse than the insertion sort. For Example: Having the following list: 3,5,1,2 where bold element means the current position. 1st Iteration: [3, 5, 1, 2] The algorithm look for the smallest element in the array after the current index which in this iteration is 3 , the result will be  1 . So the array will end like this: [ 1 , 5, 3, 2] 2nd Iteration: [ 1 ,   5 , 3, 2] The algorithm look for the smallest element in the array after the current index which in this itera...

Bubble Sort Algorithm

One of the most famous sort algorithm  in computer science is the Bubble Sort, it consist of an iterator through list element doing swaps untill all element have been sorted. The bubble sort algorithm is really simple to code but impractical to use in case when large amount of data are invoved. The average worst case performance is O(n^2) and its best is O(n) and only happens with small amount of data. There are a plenty of sort algorithms more complex but faster than the Bubble, to cite some we have: QuickSort, MergeSort, Insertion Sort and Selection Sort and others. Here I give you an example of this algorithm using C# but you can implement with any programming language: public class SortAlgorithmsByEdgar<T> where T : IComparable<T> { public void SortBubble(T[] array) {             if (array != null)             {                 b...

How to Sum Out Of Scope Element Inside Group Using Reporting Services

Image
Hello everyone, Some weeks ago I faced this problem, I had the task of SUM all element on a single sheet in a RPT file of reporting services. After looking for the solution trying and failing, I found the way and here I give you the glue. First, when we add TextBox Element on our group, it is created with a name which appear right down the property title in the property windows. This name is important for us to make all this possible. Textbox selected inside the group: Property Windows of the Textbox selected. Feel free to change that name of the textbox, now we simply SUM the values in the sheet using the object: ReportItems  as shown in below: =Sum(ReportItems!Textbox1) Now adding this to the element localized out of the group scope we will be able to sum all amount inside a group in the same sheet. See you soon. Ing. Edgar Perez