如何查找双向链表的max元素?

问题描述 投票:0回答:1

从双向列表中的文件读取数据后,我必须确定此数据的最大值。这个主题对我来说是新的,所以我需要一些帮助。这就是我所拥有的:

struct node
{
    int info;
    node *next,*back;
};
node *cap=NULL;
node *first,*last,*c,*q;
c++ binary-tree doubly-linked-list
1个回答
0
投票

* c和* q分别代表什么?

此外,如果您已经可以遍历列表,只需创建一个最大节点并在遍历时对其进行更新

© www.soinside.com 2019 - 2024. All rights reserved.