算法是一个程序的灵魂,就是说是它的思想和指导这个程序应该怎么来实现.

倚天照海花无数,流水高山心自知。

 2007-05-05 21:10
	    2007-05-05 21:10
  看到版主写下这么多的代码,真是好兴奋呀!虽然学习数据结构已经有几个月了,但是还是没有弄明白那些算法,和一个程序之间有什么联系!算法是在程序中调用的还是怎么样,一直没有弄明白,请教好多同学,他们也是说不清楚的,希望你能指点一下,谢谢了!
提供一种思想,当你做软件的时候指不定遇到什么问题,打好算法基础就能不被问题难住

 2007-05-06 10:28
	    2007-05-06 10:28
  
 2007-05-08 11:14
	    2007-05-08 11:14
  LS的看的蛮仔细.
我刚写了个小程序测试了一下.
#include "stdio.h"
#include "conio.h"
#include"malloc.h"
typedef struct node{
   int data;
   struct node *next;
}node ;
main()
{
    node *head=(node *)malloc(sizeof(node));
    head->next=NULL;
    head->next->data=3;
    printf("Hello, world%d\n",head->next->data);
    getch();
}
#include "stdio.h"
#include "conio.h"
#include"malloc.h"
typedef struct node{
   int data;
   struct node *next;
}node ;
main()
{
    node *r,*head=(node *)malloc(sizeof(node));
    head->next=NULL;
    r=head->next;
    head->next->data=3;
    printf("Hello, world%d  %d\n",head->next->data,r->data);
    getch();
}
总结:我认为.既然已经给r一个指针,它的初始化为空,但不能就判断它就是空指针了.两者是有区别的.不知道我这样解释对不对.
谢谢关注.请大家以后多提意见.

 2007-05-08 22:50
	    2007-05-08 22:50
  #include"head_node.h"
/**********************************/
/*         删除重复               */
/**********************************/
void Delete_Repeat_Node(node *head)
{
    node *p,*pre,*s;
    pre=head->next;
    p=pre->next;
    while(p)
    {
        s=p->next;
        while(s&&s->info!=p->info)
        {
            s=s->next;
        }
        if(s)
        {
            pre->next=p->next;
            free(p);
            p=pre->next;
        }
        else
        {
            pre=p;
            p=p->next;
        }
    }
}

 2007-05-10 15:35
	    2007-05-10 15:35
   2007-05-11 11:14
	    2007-05-11 11:14
  
 
										
					
	
 2007-05-11 22:46
	    2007-05-11 22:46
  
 2007-05-12 20:07
	    2007-05-12 20:07
   2007-05-12 23:29
	    2007-05-12 23:29
   2007-06-06 15:54
	    2007-06-06 15:54