| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 635 人关注过本帖
标题:一个数据结构的编程!!
取消只看楼主 加入收藏
wpscced
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2006-7-27
收藏
 问题点数:0 回复次数:0 
一个数据结构的编程!!

// shujujiegou.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

typedef struct _entry {
int key;
int data;
char name[20];
struct _entry * next;
} entry, * entry_ptr;


/*

This function inserts an entry into an ordered, singly linked list.
Each entry in the list is a structure that contains an integer key value,
a next pointer, and some other data.

The head of the linked list is saved in a pointer that is stored outside
the list itself. Within the list, the next pointer in each entry points
to the next element in the list. The end of the linked list is denoted
by the next pointer of the last entry being set to NULL.

The order of the list is determined by the key value. Entries with a lower
key value appear earlier in the list.The function is passed a pointer to the
structure that will be inserted as the new entry. The code reads the key value to determine the proper order in the list, sets the next pointer as needed, and does not change any other elements in the structure.

The function is also passed a pointer to the current head of the list, a
nd it returns the new head of the list, because this changes if the new entry needs to be inserted at the head of the list.

*/

entry_ptr insert_linked_list( entry * current_head, entry * new_element)
{

}

int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}

小弟看得似懂非懂,望大家给帮帮忙,给解释解释要达到的目的也行!!谢谢各位了

搜索更多相关主题的帖子: 数据结构 
2006-07-27 22:49
快速回复:一个数据结构的编程!!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.035985 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved