Код: Выделить всё
#include
#include
#include
using namespace std;
//element of circular linked list
struct Node {
int data;
Node* next;
Node(int value) {
data = value;
next = nullptr;
}
};
int main()
{
vector peoples;
peoples.push_back(Node(1));
peoples.push_back(Node(2));
peoples[0]->next = peoples[1];
return 0;
}
Подробнее здесь: https://stackoverflow.com/questions/796 ... linked-lis
Мобильная версия