Posts

How To Perform Merge Sort | Sorting Algorithm

Image
In computer science , merge sort is an efficient, general-purpose, comparison-based sorting algorithm .It is a divide and conquer algorithm that was invented by John von Neumann in 1945.   Algorithm        Conceptually, a merge sort works as follows: Divide the unsorted list into n sublists, each containing 1 element (a list of 1 element is considered sorted). Repeatedly merge sublists to produce new sorted sublists until there is only 1 sublist remaining. This will be the sorted list.  The following diagram shows the complete merge sort process.   Source Code:  Download the code: Merge.c #include<stdio.h> #include<stdlib.h> void mergesort(int a[],int low,int high) {     int mid=(low+high)/2;     if(low<high)     {         mergesort(a,low,mid);         mergesort(a,mid+1,high);  ...

How to create a Chess Game | Game Development in vb.net | Programming

Image
Chess,one of the most recognized board game in the world.You probably have played it once or seen it once in your lifetime.How cool it would be if we can create our own chess game. Here is the code,you can use to as reference for creating your own or you can just just clone it from Github and improve My version of Chess.  Download the code : Github :  VB_Chess (Visual Studio 2010) King.vb Public Class king     Public x_pos, y_pos As Integer     Public piece_val As Integer     Public flags(7, 7) As Boolean     Public check_the_king(7, 7) As Boolean     Public Sub New(ByVal x, ByVal y, ByVal p_val)   'color=+ve val if white color=-ve if black          x_pos = x         y_pos = y         piece_val = p_val         re_flags() ...