⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 list.c

📁 nsga2具体算法代码,用来多目标遗传算法的学习和研究
💻 C
字号:
/* A custom doubly linked list implemenation */# include <stdio.h># include <stdlib.h># include <math.h># include "global.h"# include "rand.h"/* Insert an element X into the list at location specified by NODE */void insert (list *node, int x){    list *temp;    if (node==NULL)    {        printf("\n Error!! asked to enter after a NULL pointer, hence exiting \n");        exit(1);    }    temp = (list *)malloc(sizeof(list));    temp->index = x;    temp->child = node->child;    temp->parent = node;    if (node->child != NULL)    {        node->child->parent = temp;    }    node->child = temp;    return;}/* Delete the node NODE from the list */list* del (list *node){    list *temp;    if (node==NULL)    {        printf("\n Error!! asked to delete a NULL pointer, hence exiting \n");        exit(1);    }    temp = node->parent;    temp->child = node->child;    if (temp->child!=NULL)    {        temp->child->parent = temp;    }    free (node);    return (temp);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -