วันจันทร์ที่ 14 มิถุนายน พ.ศ. 2553

IntroductionVBNET

Unlimited Free Image and File Hosting at MediaFire
Unlimited Free Image and File Hosting at MediaFire
Unlimited Free Image and File Hosting at MediaFire
Unlimited Free Image and File Hosting at MediaFire
Unlimited Free Image and File Hosting at MediaFire
Unlimited Free Image and File Hosting at MediaFire
Unlimited Free Image and File Hosting at MediaFire
Unlimited Free Image and File Hosting at MediaFire
Unlimited Free Image and File Hosting at MediaFire
Unlimited Free Image and File Hosting at MediaFire
Unlimited Free Image and File Hosting at MediaFire
Unlimited Free Image and File Hosting at MediaFire
Unlimited Free Image and File Hosting at MediaFire
Unlimited Free Image and File Hosting at MediaFire
Unlimited Free Image and File Hosting at MediaFire
Unlimited Free Image and File Hosting at MediaFire
Unlimited Free Image and File Hosting at MediaFire
Unlimited Free Image and File Hosting at MediaFire
Unlimited Free Image and File Hosting at MediaFire

Dot_Net_Framework











Pretest 3901-2007 Computer Programming 3

  1. การเขียนโปรแกรมสามารถประยุกต์ใช้กับระบบงานใดได้บ้าง
  2. อธิบายหน้าที่ของ Dot Net Framework มาตามความเข้าใจของนักศึกษา
  3. Event Drivent หมายถึง
  4. File Exe หมายถึง
  5. อธิบาย Object Programming
  6. การเขียนโปรแกรมติดต่อกับฐานข้อมูล นักศึกษาคิดว่าต้องทำอย่างไร
  7. จงทำการออกแบบ Database Relation
  8. Debug คือ

วันเสาร์ที่ 12 มิถุนายน พ.ศ. 2553

Selection Sort Algorithm

#include <stdio.h>
#include <stdlib.h>

void swap(int *x,int *y)
{
int temp;
temp = *x;
*x = *y;
*y = temp;
}

void selection_sort(int list[], int n)
{
int i, j, min;

for (i = 0; i < n - 1; i++)
{
min = i;
for (j = i+1; j < n; j++)
{
if (list[j] < list[min])
{
min = j;
}
}
swap(&list[i], &list[min]);
}
}

void printlist(int list[],int n)
{
int i;
for(i=0;i<n;i++)
printf("%d\t",list[i]);
}

void main()
{
const int MAX_ELEMENTS = 10;
int list[MAX_ELEMENTS];

int i = 0;

// generate random numbers and fill them to the list
for(i = 0; i < MAX_ELEMENTS; i++ ){
list[i] = rand();
}
printf("The list before sorting is:\n");
printlist(list,MAX_ELEMENTS);

// sort the list
selection_sort(list,MAX_ELEMENTS);

// print the result
printf("The list after sorting:\n");
printlist(list,MAX_ELEMENTS);
}

C Quicksort Algorithm



#include <stdio.h>
#include <stdlib.h>

void swap(int *x,int *y)
{
int temp;
temp = *x;
*x = *y;
*y = temp;
}

int choose_pivot(int i,int j )
{
return((i+j) /2);
}

void quicksort(int list[],int m,int n)
{
int key,i,j,k;
if( m < n)
{
k = choose_pivot(m,n);
swap(&list[m],&list[k]);
key = list[m];
i = m+1;
j = n;
while(i <= j)
{
while((i <= n) && (list[i] <= key))
i++;
while((j >= m) && (list[j] > key))
j--;
if( i < j)
swap(&list[i],&list[j]);
}
// swap two elements
swap(&list[m],&list[j]);
// recursively sort the lesser list
quicksort(list,m,j-1);
quicksort(list,j+1,n);
}
}
void printlist(int list[],int n)
{
int i;
for(i=0;i<n;i++)
printf("%d\t",list[i]);
}

void main()
{
const int MAX_ELEMENTS = 10;
int list[MAX_ELEMENTS];

int i = 0;

// generate random numbers and fill them to the list
for(i = 0; i < MAX_ELEMENTS; i++ ){
list[i] = rand();
}
printf("The list before sorting is:\n");
printlist(list,MAX_ELEMENTS);

// sort the list using quicksort
quicksort(list,0,MAX_ELEMENTS-1);

// print the result
printf("The list after sorting using quicksort algorithm:\n");
printlist(list,MAX_ELEMENTS);
}









Bubble Sort




#include
#include

void swap(int *x,int *y)
{
int temp;
temp = *x;
*x = *y;
*y = temp;
}
void bublesort(int list[], int n)
{
int i,j;
for(i=0;i<(n-1);i++) for(j=0;j<(n-(i+1));j++) if(list[j] > list[j+1])
swap(&list[j],&list[j+1]);
}

void printlist(int list[],int n)
{
int i;
for(i=0;i printf("%d\t",list[i]);
}


void main()
{
const int MAX_ELEMENTS = 10;
int list[MAX_ELEMENTS];

int i = 0;

// generate random numbers and fill them to the list
for(i = 0; i < MAX_ELEMENTS; i++ ){
list[i] = rand();
}
printf("The list before sorting is:\n");
printlist(list,MAX_ELEMENTS);

// sort the list
bublesort(list,MAX_ELEMENTS);

// print the result
printf("The list after sorting using bubble sorting algorithm:\n");
printlist(list,MAX_ELEMENTS);
}