Blog Archives

Algorithm in C# : Write a C# program to sort a array using Bubble Sort algorithm

banner_bubbles[1]

Bubble sort is one of the simplest sorting algorithm but if you ask anyone to implement on the spot it gives you an opportunity to gauge programming skills of a candidate. Let us take the array of numbers “5 1

Posted in Algorithm, C# Tagged with: ,

Algorithm in C# : How to reverse String

hellowworld

This is one of my favorite question. Since String is one of the most important type in programming, you expect lot of question related to String any data structure interview. There are many ways to reverse Sting in C# or any other programming language, and

Posted in Algorithm, C# Tagged with: ,

Algorithm in C# : In an integer array, there is 1 to 100 number, out of one is duplicate, how to find?

number array

This is a rather simple data structures question, especially for this kind of. In this case you can simply add all numbers stored in array, and total sum should be equal to n(n+1)/2. Now just subtract actual sum to expected sum,

Posted in Algorithm, C# Tagged with: ,

Algorithm in C# : How to find 3rd element from end in a linked list in one pass?

ironchain

This is another frequently asked linked list interview question. This question is exactly similar to finding middle element of linked list in single pass. If we apply same trick of maintaining two pointers and increment other pointer, when first has moved upto 3rd element, than

Posted in Algorithm, C# Tagged with: ,

Algorithm in C# : How to find if linked list has loop ?

linkedlist

This question has bit of similarity with earlier algorithm and data structure interview question. I mean we can use two pointer approach to solve this problem. If we maintain two pointers, and we increment one pointer after processing two nodes and other

Posted in Algorithm, C# Tagged with: ,

Algorithm in C# : How to find middle element of linked list in one pass?

linkedlist

One of the most popular question from data structures and algorithm, mostly asked on telephonic interview. Since many programmer know that, in order to find length of linked list we need to first traverse through linked list till we find last

Posted in Algorithm, C# Tagged with: ,

Rendering a Christmas Tree by one DIV

flynax-xmas-tree

Christmas is coming, how about rendering a Christmas tree by only ONE div with CSS?

Posted in CSS3 Tagged with: ,