Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,030

HOME > .NET Framework > Forum > ฝากช่วยแก้โค๊ดหน่อยน่ะค่ะ <b>คำสั่งจง เขียนโปรแกรมที่รวมรายการโยงสองสายเข้าด้วยกัน



 

ฝากช่วยแก้โค๊ดหน่อยน่ะค่ะ <b>คำสั่งจง เขียนโปรแกรมที่รวมรายการโยงสองสายเข้าด้วยกัน

 



Topic : 044596

Guest




คำสั่ง
จง เขียนโปรแกรมที่รวมรายการโยงสองสายเข้าด้วยกัน โดยที่ผลลัพธ์เป็นรายการโยงที่มีการเรียงลำดับจากน้อยไปมาก สมมุติให้ข้อมูลที่เก็บในรายการโยงทั้งสองสายนั้นเรียงลำดับจากน้อยไปมาก (ต้องคำนึงถึงวิธีดำเนินการที่มีประสิทธิภาพสูงสุด)
เช่น
List1: 1, 3, 5, 6, 8, 10
List2: 1, 2, 8, 16, 32, 50
AList: 1, 1, 2, 3, 5, 6, 8, 8, 10, 16, 32, 50

แก้ไขโค้ดตัวอย่างจาก
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>

typedef int NODEVAL;

typedef struct node{
NODEVAL val;
struct node *next;
} LISTNODE;

typedef struct list{
LISTNODE *head;
} LIST;

LISTNODE *getnode(NODEVAL v){
LISTNODE *n;
n = new LISTNODE;
// n = (LISTNODE *)malloc(sizeof(LISTNODE));
n->val = v;
n->next = NULL;
return n;
}

LIST *createList(){
LIST *l;
l = new LIST;
l->head = NULL;
return l;
}

// isListEmpty() is a function to check whether
// list is empty.
// return value:
// return 1 if list is empty, else return 0.
int isListEmpty(LIST *l)
{
return (l->head == NULL);
}


void insFront(LIST *l, LISTNODE *n){
n->next = l->head;
l->head = n;
}

void insAfter(LISTNODE *pre, LISTNODE *n){
n->next = pre->next;
pre->next = n;
}

void insEnd(LISTNODE *pre, LISTNODE *n){
insAfter(pre, n);
}

void insOrdList(LIST *l, LISTNODE *n){
if(isListEmpty(l))
insFront(l, n); // ins first node
else{
LISTNODE *ptr, *pre=NULL;
ptr = l->head;
while((ptr->val < n->val ) && ptr->next!=NULL){
pre = ptr;
ptr = ptr->next;
}
if(ptr->val == n->val)
insAfter(ptr, n); // same val, ins into
else{
if(ptr->val < n->val) // ins end
insAfter(ptr, n);
else if(ptr==l->head)
insFront(l, n); // ins before head-node
else
insAfter(pre, n); // ins between list
}
}
}

void delFront(LIST *l){
LISTNODE *save;
save = l->head;
l->head = (l->head)->next;
delete save; // free(save);
}

void delAfter(LISTNODE *pre){
LISTNODE *save;
save = pre->next;
pre->next = save->next;
delete save; // free(save);
}

void delOrdList(LIST *l, NODEVAL target){
if(isListEmpty(l))
return;
else{
LISTNODE *ptr, *pre=NULL;
ptr = l->head;
while((ptr->val != target) && ptr->next!=NULL){
pre = ptr;
ptr = ptr->next;
}
if(ptr->val != target)
return; // no data found.
else{
if(ptr==l->head)
delFront(l); // del head
else
delAfter(pre); // del after
}
}
}

void printList(LIST *l)
{
LISTNODE *ptr = l->head;
while( ptr != NULL ){
printf("%3d", ptr->val);
ptr = ptr->next; // next node
}
printf("\n");
}

main()
{
LIST *list;
LISTNODE *node;
list = createList();
int i, v;
for(i=1;i<=4;i++){
printf("INSERT number(%d) into list: ", i);
scanf("%d", &v);
node = getnode(v);
insOrdList(list, node);
}

printList(list);

printf("DELETE: ");
scanf("%d", &v);
delOrdList(list, v);

printList(list);

getch();
}

ลองก็อปไปวางในภาษาซีดูน่ะค่ะ
ใน main() ให้มีได้ 2 list จากนั้นจึงสร้างฟังก์ชัน mergeList() เพื่อผสาน list ทั้งสอง
void mergeList(LIST *l1, LIST *l2){
?? ...
?? ...
}
ฝากด้วยน่ะค่ะขอบคุณมากค่ะ




Tag : - - - -







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2010-06-27 23:11:31 By : pleza View : 1561 Reply : 10
 

 

No. 1



โพสกระทู้ ( 3,144 )
บทความ ( 1 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์


หุหุ วันนี้จะแกล้งอะไรดีน้า

https://www.thaicreate.com/dotnet/forum/044483.html

https://www.thaicreate.com/dotnet/forum/044330.html

----------------------------------

เอ้า!!! จะแนะให้ เดี๋ยวจะหาว่าใจร้าย

มันเป็น array ใช่ไหมล่ะ ก็จับเอารวมกันก่อนสิจากนั้นก็ sort

จะใช้ sort แบบไหนก็เลือกเอาด้านล่าง

- select
- bubble
- insert
- merge
- heap
- radix
- shell
- quick

Code (C)
#include <stdio.h>
#include <conio.h>
#include <bios.h>

#define ESC     27
#define ENTER   13
#define UPKEY  328
#define DWKEY  336
#define Null -9735

/* function prototype */
void select(void);
void bubble(void);
void insert(void);
void merge(void);
void heap(void);
void radix(void);
void shell(void);
void quick(int fornt, int rear);
void display(void);
void windows(int le, int to, int ri, int bo, char *name);
void cursor(int x);
void cur_on(void);
void cur_off(void);
int  power(int i, int j);
int  input(void);
int  menu(void);
int  getkey(void);

/* global variable */
int data[14], buffer[14], check=0, count, swap, member;

void main(void)
{
	int i, choice;

	do{
		textcolor(LIGHTGRAY);
		cur_on();
		choice=menu();
		switch(choice){
			case 1:
				member=input();
				break;
			case 2:
				windows(1, 8, 80, 19, "Selection sort");
				select();
				break;
			case 3:
				windows(1, 8, 80, 19, "Bubble sort");
				bubble();
				break;
			case 4:
				windows(1, 8, 80, 19, "Insertion sort");
				insert();
				break;
			case 5:
				windows(1, 8, 80, 19, "Merge sort");
				merge();
				break;
			case 6:
				windows(1, 8, 80, 19, "Heap sort");
				heap();
				break;
			case 7:
				windows(1, 8, 80, 19, "Radix sort");
				radix();
				break;
			case 8:
				windows(1, 8, 80, 19, "Shell sort");
				shell();
				break;
			case 9:
				windows(1, 8, 80, 19, "Quick sort");
				count=0;
				swap=0;
				for(i=0;i<member;i++)
					buffer[i]=data[i];
				quick(0, member-1);
				display();
				break;
			case 10:
				clrscr();
				printf("------------------------------------------------------------------------------\n");
				printf("\n\t\t\t\[email protected]\n");
				printf("\n\n------------------------------------------------------------------------------\n\n");
				break;}
	} while(choice!=10);
}

void select(void)
{
	int i, j, temp;

	count=0;
	swap=0;
	for(i=0;i<member;i++)
		buffer[i]=data[i];
	/* sort */
	for(i=0;i<member;i++)
		for(j=i+1;j<member;j++){
			if(buffer[j]<buffer[i]){
				temp=buffer[i];
				buffer[i]=buffer[j];
				buffer[j]=temp;
				swap++;}
			count++;}
	display();
} /* selection sort */

void bubble(void)
{
	int i, j=0, temp;

	count=0;
	swap=0;
	for(i=0;i<member;i++)
		buffer[i]=data[i];
	/* sort */
	i=1;
	while(i!=member){
		if(buffer[j]>buffer[j+1]){
			temp=buffer[j];
			buffer[j]=buffer[j+1];
			buffer[j+1]=temp;
			swap++;
			if(j>0)
				j--;
			i=j+1;}
		else{
			j=i;
			i++;}
		count++;}
	display();
} /* bubble sort */

void insert(void)
{
	int i, j, temp;

	count=0;
	swap=0;
	for(i=0;i<member;i++)
		buffer[i]=data[i];
	/* sort */
	for(i=1;i<member;i++){
		if(buffer[i]<buffer[i-1]){
			temp=buffer[i];
			j=i;
			while(j>0&&buffer[j-1]>temp){
				buffer[j]=buffer[j-1];
				swap++;
				j--;}
			buffer[j]=temp;}
		count++;}
	display();
} /* insertion sort */

void merge(void)
{
	int i, j, k, l, n, temp, level=0, group, start, end;

	count=0;
	swap=0;
	for(i=0;i<member;i++)
		buffer[i]=data[i];
	/* sort */
	i=member;
	while(i!=1){
		i=i/2 + i%2;
		level++;}
	group=member;
	n=1;
	for(i=0;i<level;i++){
		group=group/2 + group%2;
		n=n*2;
		count++;
		for(j=0;j<group;j++){
			start=j*n;
			end=start+n;
			if(end>member)
				end=member;
			for(k=start;k<end-1;k++)
				for(l=k+1;l>start;l--){
					if(buffer[l]<buffer[l-1]){
						temp=buffer[l];
						buffer[l]=buffer[l-1];
						buffer[l-1]=temp;
						swap++;}
					else l=start;}}}
	display();
} /* merge sort */

void heap(void)
{
	int i, j, k, temp;

	count=0;
	swap=0;
	for(i=0;i<member;i++)
		buffer[i]=data[i];
	/* create heap */
	for(i=1;i<member;++i){
		j=i;
		temp=buffer[i];
		k=j/2;
		while(j>0&&temp>buffer[k]){
			buffer[j]=buffer[k];
			j=k;
			k=j/2;
			if(k<0)
				k=0;}
		buffer[j]=temp;}
	/* sort */
	for(i=member-1;i>=1;--i){
		count++;
		temp=buffer[0];
		buffer[0]=buffer[i];
		buffer[i]=temp;
		j=0;
		temp=buffer[0];
		k=1;
		if(k+1<i)
			if(buffer[k+1]>buffer[k])
				k++;
		while(k<=i-1&&buffer[k]>temp){
			buffer[j]=buffer[k];
			j=k;
			k=2*j+1;
			if(k+1<i)
				if(buffer[k+1]>buffer[k])
					k++;
			else
				if(k>member)
					k=member;
			swap++;
			buffer[j]=temp;}}
	display();
} /* heap sort */

void radix(void) /* ERROR while some value of data < Zero */
{
	int i, j, k, l, level, temp[10][14];

	count=0;
	swap=0;
	for(j=0;j<member;j++){
		buffer[j]=data[j];
		for(i=0;i<10;i++)
			temp[i][j]=Null;}
	/* find level */
	for(i=0;i<member;i++)
		if(i==0)
			j=buffer[i];
		else if(buffer[i]>j)
			j=buffer[i];
	if(j<10000&&j<1000&&j<100&&j<10)
		level=1;
	else if(j<10000&&j<1000&&j<100)
		level=2;
	else if(j<10000&&j<1000)
		level=3;
	else if(j<10000)
		level=4;
	else
		level=5;
	/* sort */
	for(j=0;j<level;j++){
		for(i=0;i<10;i++){
			k=0;
			for(l=0;l<member;l++){
				count++;
				if(((buffer[l]/power(10, j))%10)==i){
					temp[i][k]=buffer[l];
					swap++;
					k++;}}}
		l=0;
		for(i=0;i<10;i++){
			k=0;
			count++;
			while(temp[i][k]!=Null){
				buffer[l]=temp[i][k];
				temp[i][k]=Null;
				l++;
				k++;}}}
	display();
} /* radix sort */

void shell(void)
{
	int i, j, temp;

	count=0;
	swap=0;
	for(i=0;i<member;i++)
		buffer[i]=data[i];
	/* sort */
	j=member;
	while(j!=1){
		j=(j+1)/2;
		for(i=0;i<member;i++)
			if(buffer[i]>buffer[i+j]&&i+j<member){
				temp=buffer[i];
				buffer[i]=buffer[i+j];
				buffer[i+j]=temp;
				swap++;}
		count++;}
	display();
} /* shell sort */

void quick(int front, int rear)
{
	int i, j, key, temp, flag=1;

	count++;
	if(front>=rear)
		return;
	i=front;
	j=rear+1;
	key=buffer[front];
	while(flag){
		i++;
		while(buffer[i]<key)
			i++;
		j--;
		while(buffer[j]>key)
			j--;
		if(i<j){
			temp=buffer[i];
			buffer[i]=buffer[j];
			buffer[j]=temp;
			swap++;}
		else
			flag=0;}
	temp=buffer[front];
	buffer[front]=buffer[j];
	buffer[j]=temp;
	swap++;

	quick(front, j-1);
	quick(j+1, rear);
} /* quick sort */

void display(void)
{
	int i;

	textcolor(YELLOW);
	cur_off();
	gotoxy(6, 11); printf("Count Loop:"); cprintf("%8d", count);
	gotoxy(6, 12); printf("Swap Value:"); cprintf("%8d", swap);
	gotoxy(6, 14); printf("Data: {");
	for(i=0;i<member;i++){
		cprintf("%8d", buffer[i]);
		if(i!=member-1)
			printf(",");
		if(i==6&&member>7)
			gotoxy(13, 15);}
	printf("}");
	do{
		gotoxy(53 ,18); printf(" Press [ESC] back to menu ");
		gotoxy(60 ,18); cprintf("[ESC]");
	} while(getkey()!=ESC);
	textcolor(LIGHTGRAY);
}

int power(int i, int j)
{
	int   loop;
	float ans=1;

	if(j!=0){
		for(loop=0;loop<j;loop++)
			ans=ans*i;
		return ans;}
	else
		return 1;
} /* a^n */

int input(void)
{
	int row, col=41, i, key, member;

	cur_on();
	check=1;
	windows(1, 1, 80, 25, "Input Data");
	textcolor(YELLOW);
	gotoxy(53, 24); printf(" Press [ESC] back to Menu ");
	gotoxy(60, 24); cprintf("[ESC]");
	do{
		gotoxy(50, 4); printf("           ");
		gotoxy(23, 4); printf("Enter amount of member (Max 14): ");
		scanf("%d", &member);
	} while(member>14||member<1);
	cur_off();
	row=1+(25-member)/2;
	for(i=0;i<member;i++){
		data[i]=0;
		gotoxy(30, row+i); printf("Data["); cprintf("%2d", i+1); printf("] = ");
		gotoxy(41, row+i); printf("%8d", data[i]);}
	gotoxy(23, 21); printf("Value of Data[1]: ");
	gotoxy(42, 21); cprintf("%d", data[0]);
	textbackground(BLUE);
	textcolor(LIGHTGRAY);
	i=0;
	gotoxy(col, row); cprintf("%8d", data[i]);
	do{
		switch(key=getkey()){
			case DWKEY:
				if(row<((25-member)/2)+member){
					textbackground(BLACK);
					textcolor(LIGHTGRAY);
					gotoxy(col, row); cprintf("%8d", data[i]);
					gotoxy(35, 21); cprintf("                                  ");
					textcolor(YELLOW);
					i++;
					gotoxy(23, 21); printf("Value of Data[%d]: ", i+1);
					gotoxy(42, 21); cprintf("%d", data[i]);
					textbackground(BLUE);
					row++;
					textcolor(LIGHTGRAY);
					gotoxy(col, row); cprintf("%8d", data[i]);}
				break;
			case UPKEY:
				if(row>1+(25-member)/2){
					textbackground(BLACK);
					textcolor(LIGHTGRAY);
					gotoxy(col, row); cprintf("%8d", data[i]);
					gotoxy(35, 21); cprintf("                                  ");
					textcolor(YELLOW);
					i--;
					gotoxy(23, 21); printf("Value of Data[%d]: ", i+1);
					gotoxy(42, 21); cprintf("%d", data[i]);
					textbackground(BLUE);
					row--;
					textcolor(LIGHTGRAY);
					gotoxy(col, row); cprintf("%8d", data[i]);}
				break;
			case ENTER:
				textbackground(BLACK);
				textcolor(LIGHTGRAY);
				cur_on();
				gotoxy(23, 21); cprintf("                                  ");
				gotoxy(23, 21); cprintf("Enter value of Data[%d]: ", i+1);
				scanf("%d", &data[i]);
				gotoxy(col, row); cprintf("%8d", data[i]);
				if(row!=((25-member)/2)+member){
					row++; i++;}
				gotoxy(20, 21); cprintf("                                  ");
				textcolor(YELLOW);
				gotoxy(23, 21); printf("Value of Data[%d]:", i+1);
				gotoxy(42, 21); cprintf("%d", data[i]);
				textbackground(BLUE);
				textcolor(LIGHTGRAY);
				gotoxy(col, row); cprintf("%8d", data[i]);
				cur_off();
				break;}
		} while(key!=ESC);
	textbackground(BLACK);
	return member;
} /* input data */

int menu(void)
{
	int choice, key,  row=7, pass=0;

	windows(1, 5, 80, 21, "Sorting");
	gotoxy(1, 1); printf("Program Homework X");
	textcolor(YELLOW);
	gotoxy(32, 7); printf("[0] Input Data");
	gotoxy(32, 7); cprintf("[0]");
	gotoxy(32, 8); printf("[1] Selection sort");
	gotoxy(32, 9); printf("[2] Bubble sort");
	gotoxy(32, 10); printf("[3] Insertion sort");
	gotoxy(32, 11); printf("[4] Merge sort");
	gotoxy(32, 12); printf("[5] Heap sort");
	gotoxy(32, 13); printf("[6] Radix sort");
	gotoxy(32, 14); printf("[7] Shell sort");
	gotoxy(32, 15); printf("[8] Quick Sort");
	gotoxy(32, 16); printf("[9] Exit");
	gotoxy(32, 16); cprintf("[9]");
	if(check==1){
		gotoxy(32, 8); cprintf("[1]");
		gotoxy(32, 9); cprintf("[2]");
		gotoxy(32, 10); cprintf("[3]");
		gotoxy(32, 11); cprintf("[4]");
		gotoxy(32, 12); cprintf("[5]");
		gotoxy(32, 13); cprintf("[6]");
		gotoxy(32, 14); cprintf("[7]");
		gotoxy(32, 15); cprintf("[8]");}
	gotoxy(29, 18); printf("Please select choice: ");

	gotoxy(29, row); cprintf(">");
	gotoxy(51, 18); cprintf("%d", row-7);
	do{
		switch(getkey()){
			case DWKEY:
				if(row<16){
					gotoxy(29, row); cprintf("  ");
					row++;
					cursor(row);}
				break;
			case UPKEY:
				if(row>7){
					gotoxy(29, row); cprintf("  ");
					row--;
					cursor(row);}
				break;
			case '0':
				gotoxy(29, row); cprintf("  ");
				row = 7;
				cursor(row);
				break;
			case '1':
				gotoxy(29, row); cprintf("  ");
				row = 8;
				cursor(row);
				break;
			case '2':
				gotoxy(29, row); cprintf("  ");
				row = 9;
				cursor(row);
				break;
			case '3':
				gotoxy(29, row); cprintf("  ");
				row = 10;
				cursor(row);
				break;
			case '4':
				gotoxy(29, row); cprintf("  ");
				row = 11;
				cursor(row);
				break;
			case '5':
				gotoxy(29, row); cprintf("  ");
				row = 12;
				cursor(row);
				break;
			case '6':
				gotoxy(29, row); cprintf("  ");
				row = 13;
				cursor(row);
				break;
			case '7':
				gotoxy(29, row); cprintf("  ");
				row = 14;
				cursor(row);
				break;
			case '8':
				gotoxy(29, row); cprintf("  ");
				row = 15;
				cursor(row);
				break;
			case '9':
				gotoxy(29, row); cprintf("  ");
				row = 16;
				cursor(row);
				break;
			case ESC:
				choice=10;
				pass=1;
				break;
			case ENTER:
				if(row==7){
					choice = 1; pass=1;}
				else if(row>7&&row<16&&check==1){
					choice = row-6; pass=1;}
				else if(row==16){
					choice = 10; pass=1;}
				else
					pass=0;
				break;
		} /* switch */
	} while (pass!=1);
	textcolor(LIGHTGRAY);
	return choice;
} /* menu */

void windows(int le, int to, int ri, int bo, char *title)
{
	int i;
	clrscr();
	for(i=le;i<ri;i++){
		gotoxy(i, to); printf("อ");
		gotoxy(i, bo-1); printf("อ");}
	for(i=to;i<bo;i++){
		gotoxy(le, i); printf("บ");
		gotoxy(ri, i); printf("บ");}
	gotoxy(le, bo-1); printf("ศ");
	gotoxy(ri, bo-1); printf("ผ");
	gotoxy(le, to); printf("ษ");
	gotoxy(ri, to); printf("ป");
	textcolor(YELLOW);
	gotoxy(((ri-le)-strlen(title))/2, to); cprintf(" %s ", title);
	textcolor(LIGHTGRAY);
} /* windows */

void cursor(int x)
{
	gotoxy(29, x); cprintf(">");
	gotoxy(51, 18); printf("        ");
	gotoxy(51, 18); cprintf("%d", x-7);
} /* cursor position */

int getkey(void) /* Uses the BIOS to read the next keyboard character */
{
	int key, lo, hi;

	key = bioskey(0);
	lo = key & 0X00FF;
	hi = (key & 0XFF00) >> 8;

	return((lo == 0) ? hi + 256 : lo);
} /* getkey */

void cur_on(void)
{
	union REGS reg;
	reg.h.ch = 0x0b; /* top cursor line */
	reg.h.cl = 0x0d; /* bottom cursoe line */
	reg.h.ah = 1;   /* call BIOS function */
	int86(0x10, &reg, &reg);
} /* cursor on */

void cur_off(void)
{
	union REGS reg;
	reg.h.ch = 0x20; /* turn on bit 5 */
	reg.h.cl = 0;
	reg.h.ah = 1;   /* call BIOS function */
	int86(0x10, &reg, &reg);
} /* cursor off */







Date : 2010-06-27 23:25:13 By : tungman
 


 

No. 2



โพสกระทู้ ( 308 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook Blogger

เป็นการบ้านแน่เลยอ่า....มีคำสั่งด้วย
Date : 2010-06-28 02:49:00 By : blacklion
 

 

No. 3



โพสกระทู้ ( 308 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook Blogger

โหๆ พี่ tungman format เครื่องเลยเหรอคับ
Date : 2010-06-28 02:52:36 By : blacklion
 


 

No. 4

Guest


พี่คร้าโค๊ดที่พี่หั้ยอ่ะ มันERROR เต็มเลยอ่ะ ทามไงอ่ะ หุ หุ จะส่งวันนี้แล้วอ่ะค่ะตอนห้าทุ่ม ช่วยทีน่ะค่ะ
Date : 2010-06-30 17:38:19 By : pleza
 


 

No. 5



โพสกระทู้ ( 3,144 )
บทความ ( 1 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์


Quote:
พี่คร้าโค๊ดที่พี่หั้ยอ่ะ มันERROR เต็มเลยอ่ะ ทามไงอ่ะ หุ หุ จะส่งวันนี้แล้วอ่ะค่ะตอนห้าทุ่ม ช่วยทีน่ะค่ะ


error ได้ไงเมื่อ 10 ปีที่แล้วมันยังรันได้อยู่เลย !!!
Date : 2010-06-30 18:24:29 By : tungman
 


 

No. 6

Guest


10 ปีเลยหรอพี่ งั้นพี่ช่วยนู๋ใหม่หน่อยในกระทู้ที่นู๋โพสต์ใหม่อ่ะ pleza เหมือนกัล อันนี้พี่อาจจะอ่านคำสั่งมันไม่เข้าใจในอีกกระทู้นึงน่าจะอ่านง่ายก่า ช่วยหน่อยน่ะค่ะ จะส่งห้าทุ่มแล้วตอนนี้นู๋ก้อพยายามแก้อยุ่อ่ะค่ะ
Date : 2010-06-30 18:27:12 By : pleza
 


 

No. 7

Guest


Int i,v,a,b;

for(i=1;i<=6;i++){
printf("INSERT number(%d) into list1: ", i);
scanf("%d", &v);
node = getnode(v);
insOrdList(list, node);
}
for(a=1;a<=6;a++){
printf("INSERT number(%d) into list2: ", a);
scanf("%d", &b);
node = getnode(b);
insOrdList(list, node);
}

ไม่น่าจะเกินนี้น่ะจ๊ะ

แก้แค่ส่วนนี้น่ะ
Date : 2010-06-30 22:04:40 By : SniperQQ
 


 

No. 8

Guest


งงอ่ะค่ะพี่ ไงค่ะที่ว่าแค่ส่วนนี้อ่ะ
Date : 2010-06-30 22:23:59 By : pleza
 


 

No. 9

Guest


แก้ส่วนที่ไฟล์ ตัวอย่างเราหั้ยมาอ่ะ ไปดูโจท สิ
Date : 2010-06-30 22:57:37 By : SniperQQ
 


 

No. 10

Guest


แต่นู๋แก้แล้วอ่ะค่ะแต่มันก้อไม่ได้อยากตัวอย่างอยุ่ดีมันต้องออกมาแบบนี้อ่ะค่ะ
List1: 1, 3, 5, 6, 8, 10
List2: 1, 2, 8, 16, 32, 50
AList: 1, 1, 2, 3, 5, 6, 8, 8, 10, 16, 32, 50
แล้วแก้ตามโค๊ดอ่ะค่ะ แต่หั้ยใช้ฟังก์ชั่นนี้อ่ะค่ะ
void mergeList(LIST *l1, LIST *l2){
?? ...
?? ...
}
Date : 2010-06-30 23:02:37 By : pleza
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ฝากช่วยแก้โค๊ดหน่อยน่ะค่ะ <b>คำสั่งจง เขียนโปรแกรมที่รวมรายการโยงสองสายเข้าด้วยกัน
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 02
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่