A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://TheAlgorithms.github.io/C-Plus-Plus/d3/d09/node_8hpp_source.html below:

TheAlgorithms/C++: data_structures/node.hpp Source File

Go to the documentation of this file. 5#ifndef DATA_STRUCTURES_NODE_HPP_ 6#define DATA_STRUCTURES_NODE_HPP_ 15template

<

class

ValueType>

17 using

value_type = ValueType;

19

std::shared_ptr<Node<ValueType>> next = {};

22template

<

typename

Node,

typename

Action>

23void

traverse(

const Node

*

const

inNode,

const

Action& action) {

26

traverse(inNode->next.get(), action);

30template

<

typename

Node>

31void

display_all(

const Node

*

const

inNode) {

33

[](

const Node

& curNode) { std::cout << curNode.data <<

" "

; });

36template

<

typename

Node>

37

std::vector<typename Node::value_type> push_all_to_vector(

38 const Node

*

const

inNode,

const

std::size_t expected_size = 0) {

39

std::vector<typename Node::value_type> res;

40

res.reserve(expected_size);

42

[&res](

const Node

& curNode) { res.push_back(curNode.data); });


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4