list.h
来自「使用DIJKSTAR算法解决多点最短路径,还带文字解说」· C头文件 代码 · 共 48 行
H
48 行
/* list.h - Robert Ollington - 1/8/05
(based upon Mike Cameron-Jones' C implementation for KXA251)
This is just the header file for the functions implemented in list.cpp
It illustrates the use of #ifndef and #define that prevents the definitions
being included twice when the file itself is included twice by mistake.
*/
#ifndef _LIST_H
#define _LIST_H
#include "connection.h"
/* Define node type */
class node
{
public:
connection data_item;
node* next;
node();
node(connection n);
};
class list
{
private:
node* first;
public:
/* Constuctor and Destructor */
list();
~list();
/* Function to insert n at front of list */
void insert_at_front(connection n);
/* Function to print list */
void print();
/* Function to insert n in (non-decreasing) order in list - assuming list
items are already in (non-decreasing) order. */
void insert_in_order(connection n);
connection* getConnection(int index);
};
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?