这是C编程语言中链表的代码.
#include <stdio.h> /* For printf */
#include <stdlib.h> /* For malloc */
typedef struct node {
int data;
struct node *next; /* Pointer to next element in list */
} LLIST;
LLIST *list_add(LLIST **p, int i);
void list_remove(LLIST **p);
LLIST **list_search(LLIST **n, int i);
void list_print(LLIST *n);
Run Code Online (Sandbox Code Playgroud)
代码没有完成,但我认为这对我的问题已经足够了.这里在结构节点的末尾使用"LLIST",它也用作函数原型的返回类型list_add.到底是怎么回事?
我不知道如何解决这个问题.请看一下,如果可能的话,让我如何解决它.这是我的pom.xml文件.
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.1.5.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-cypher-compiler-2.1</artifactId>
<version>2.1.2</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
<version>1.8.9.1</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>15.0</version>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-cypher-compiler-2.0</artifactId>
<version>2.0.3</version>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-cypher-compiler-1.9</artifactId>
<version>2.0.3</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
<exclusions> …Run Code Online (Sandbox Code Playgroud) 有人可以解释一下吗?
struct node
{
int data;
struct node * link;
}
main()
{
struct node *p, *list, *temp;
list = p = temp = NULL;
.........................
.........................
}
addbeg()
{
int x;
temp=malloc(sizeof(struct node));
scanf("%d", &x);
temp->data=x;
temp->link = list;
list=temp;
}
Run Code Online (Sandbox Code Playgroud)
这是一个通过C语言在链表中输入数据的代码.代码不完整,但我认为它足以达到目的.请解释基本上这些代码的编码:
temp=malloc(sizeof(struct node));
Run Code Online (Sandbox Code Playgroud)
和
temp->link = list;
list=temp;.
Run Code Online (Sandbox Code Playgroud)