Student Of Fortune
Showing posts with label VisualBasic. Show all posts
Showing posts with label VisualBasic. Show all posts

Quick Sort In C language

One of the sorting algorithm that is not less important to learn the Quick Sort algorithm. This algorithm is popularly used in the programming world. Therefore, I will explain a little about the Quick Sort algorithm in C + + programming language.

Quick Sort algorithm discovered by C.A.R Hoare. Quick sort, as the name suggests, is claimed as a sorting algorithm that is faster than other sorting algorithms.

However, this algorithm, according to my own too, is considered quite difficult to be understood than others, due to master these algorithms, necessary knowledge about algorithms and patterns of recursive divide-and-concuer. What the hell is that? Below I ulaskan little (very little:)) on both schemes.
Divide
Sorting data group into two sub-groups of data.
Conquer
Sort the elements in the sub-series recursively.
Recursive
The method in which the contents of a function contains function calls itself.
For more details can be seen in the syntax below:
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>

#define MAX 30
#define INPUT 'i'
#define OUTPUT 'o'
#define TRUE 1
#define FALSE 0
#define _MY_DEBUG
#if defined(_MY_DEBUG)
    #define TRACE_LINE printf("\n\n- Program Statistics :\n1. File : %s\n2. Date : %s\n3. Time : %s\n",__FILE__,__DATE__,__TIME__);
#else
    #define TRACE_LINE
#endif

int ChoosePivot(int, int);
    void InputOutput(int*, const int, const char),
        QuickSort(int*, int, int),
    Swap(int*, int*),
FreeBuffer(int*);

int main(int argc, char *argv[]) {
    system("COLOR 5");
    int *buffer = NULL, max;
    printf("Implementasi Quick Sort [Ascending]\nJumlah data [MAX:30] : ");
    scanf("%d",&max);
    fflush(stdin);
    if((max > FALSE) && (max <= MAX)) {
        buffer = (int*)calloc(max,sizeof(int));
        InputOutput(buffer,max,INPUT);
        printf("\n1. Data yang anda masukkan : ");
        InputOutput(buffer,max,OUTPUT);
        QuickSort(buffer,FALSE,(max-TRUE));
        printf("\n2. Data setelah disorting : ");
        InputOutput(buffer,max,OUTPUT);
        FreeBuffer(buffer);
    }
    TRACE_LINE;
    getch();
    fflush(stdin);
    return(EXIT_SUCCESS);
}

void InputOutput(int* buffer, int max, const char STAT) {
    int i;
    if(INPUT == STAT) {
        for(i = 0; i < max; ++i) {
            printf("%d. Data ke-%d : ",(i+TRUE),(i+TRUE));
            scanf("%d",&buffer[i]);
            fflush(stdin);
        }
    } else if(OUTPUT == STAT) {
        for(i = 0; i < max; ++i) {
            printf("%d ",buffer[i]);
        }
    }
}

int ChoosePivot(int top, int bottom) {
    return((top+bottom)/2);
}

void QuickSort(int* buffer, int bottom, int top) {
    int i, j, k, pivot; // m = bottom, n = top;
    if(bottom < top) {
        pivot = ChoosePivot(bottom,top);
        Swap(&buffer[bottom],&buffer[pivot]);
        i = bottom+TRUE; j = top; k = buffer[bottom];
        while(i <= j) {
            while((i <= top) && (buffer[i] <= k)) {
                ++i;
            }
            while((j >= bottom) && (buffer[j] > k)) {
                --j;
            }
            if(i < j) {
                Swap(&buffer[i],&buffer[j]);
            }
        }
        Swap(&buffer[bottom],&buffer[j]);
        QuickSort(buffer,bottom,(j-TRUE));
        QuickSort(buffer,(j+TRUE),top);
    }
}

void Swap(int* buffer1, int* buffer2) {
    int tmp = *buffer1;
    *buffer1 = *buffer2;
    *buffer2 = tmp;
}

void FreeBuffer(int* buffer) {
    free(buffer);
    buffer = NULL;
}
See The Out Put :

Aplication Knowing the Birthday and Star a person with visual basic

This program was made to determine the day of birth and type of stars you have. same as zodiag. Still very simple code that can be learned and combined with other code.We hope to provide benefits . Please developed itself

download tutorial code here


Electronic Receipt Program Application With Visual Basic

Examples of simple receipt program using Crystal Report 8.5 as a medium for printing, Microsoft Access as the database. We hope to provide benefits . Please developed itself

download tutorial code here

Creating Application Dictionary With Visual Basic

Source Code is to make the application dictionary, a database from Access, created with Visual Basic 6. We often use a dictionary application, but we often do not know how to make the application dictionary. This application please expand again. please download the tutorial code below.

download tutorial code here

Application Program Packer with Visual Basic

Application for file compression program. Using the Huffman Algorithm And File Checksum CRC32. The program is still a lot of shortcomings. This application please expand again. please download the tutorial code below.

download tutorial code here

Camouflage Techniques Folder With Visual Basic

To protect the folder so not open to others. Very useful for those who want to create secret folders, so that other people do not know what the contents of that folder. This application uses the basic techniques of virus, which protects a folder. However, this application is safe to try. NO VIRUS

download tutorial code here .

Executor v1.0 Application With Visual Basic

Source code for this application I created to facilitate the application and open the folder you want, using programming code which is simple, so easy to understand.Using a database of distinguished form normal txt file. I also equip it with a code to do a search with string for easy searching in the database, similar to a simple search engine. please download the code below.

Download tutorial code here

Protect Folder The Runtime Program With Visual Basic

Providing security on the folder in runtime, keeping the folder can not be removed and replaced his name. The program is flawed. Please be edited and studied. please download the code below. Good luck.

download tutorial code here

Simulation of RTP (Real Time Protector) Antivirus With Visual Basic

This is an example RTP (Real Time Protection) for the antivirus when the folder is first opened. Source code was still ragged and irregular. Please be learned and developed. Such scanning systems are based on the time interval during which we open a folder then the task is the RTP scan before a user to execute files inside the folder. Drawback of this RTP system is slow opening folders. The surplus is very useful for protection so users do not precede the antivirus. And the RTP system is still using CRC32 checks. Please download the source code below
 
Remember the code is not perfect.
download tutorial code here

Program Security With Visual Basic

Program ini sangatn berguna bagi teman teman untuk melindungi komputer dari orang yang mau mengambil data tanpa izin . Program ini masih dalam pengembangan silahkan dikembangkan lagi.download source codenya bisa di download dibawah ini.

download tutorial code disini

Binary File Cryptor Dengan ActiveX DLL with Visual Basic

Memanfaatkan file ActiveX DLL, kita bisa membuat cryptor yang dapat mengenkripsi file biner(binary). Karena ActiveX DLL bersifat COM Object, file ini bisa digunakan oleh script interpreter seperti Visual Basic Script dan JScript (JavaScript). Bisa digunakan sebagai plugin untuk aplikasi Visual Basic 6 anda. Selamat mencoba dan semoga bermanfaat.

download tutorial code disini
 

Contoh Membuat Operating System (OS) With Visual Basic

Operating System seperti Windows,ini adalah salah satu pembuatan SO secara sederhana dan masih sangat basic silahkan dikembangkan lagi dan jangan lupa komentarnya

download tutorial code disini

Phytagoras Calculator Final with visual basic

Gile.... Padahal cuman aplikasi sederhana buatan VIS_AstRo, bisa aku bikin jagi kayak gini. silanhkan coba dan bisa dikembangkan sendiri. tapi jangan lupa komentarnya or bisa follow blog ini.

download tutorial code disini

Bitmap2Ico Converter with visual basic

Mengkonversi File Bitmap Ke Icon. Agar bisa digunakan sebagai icon Project VB6 anda. silahkan dikembangkan sendiri. jangan lupa komentarnya biar tambah akrab dan sering sering mampir di blog ini.

download tutorial code disini

ATV Guard antivirus 1.0.2 BETA with visual basic

ATV Guard antivirus 1.0.2 BETA meliputi Firewall, Registry Fixer, Database Eksternal, Process Manager, Quarantine virus, RTP[Real Time Protection].Source code ini silahkan dikembangkan lebih baik lagi .. ^_^

download tutorial code disini
 
Recommended Post Slide Out For Blogger

Recent Comments

My Rank