Node

                Never    
C#
       
/*
            1-      O  (Node) -> value, childCount, getChildByIndex
                   / \
            2-    O   O  (Child)  
                    |
                    |
                   \|/    
                    V
                 MaxValue
*/

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Data.SqlTypes;

class Node
{
    private double value;
    private int childrenCount;
    private Node next;
    private Node front;
    private Node rear;
    private Node newPtr;
    private Node currentlyValue;
    private Node maxValue;

    private Node()
    {
        value = 0;
        childrenCount = 0;
        next = null;
        front = null;
        rear = null;
    }

    void insertValue(double element)
    {
        if (childrenCount == 0)
        {
            front = new Node();
            front.value = element;
            front.next = null;
            rear = front;
            childrenCount++;
        }
        else
        {
            newPtr = new Node();
            newPtr.value = element;
            newPtr.next = null;
            rear.next = newPtr;
            rear = newPtr;
            childrenCount++;
        }
    }

    void getMaxValueFromNode()
    {
        while (currentlyValue.next != null)
        {
            /* std::sort(double )(currentlyValue[0].value, currentlyValue[i].value);
            currentlyValue[i].value = currentlyValue->value;
            if (currentlyValue[i].value == currentlyValue->value)
                maxValue->value = currentlyValue[i].value;
            else if (currentlyValue[i].value > maxValue->value)*/

            if (maxValue.Equals(currentlyValue.value))
            {
                maxValue = currentlyValue;
            }

            currentlyValue = currentlyValue.next;
        }

        Console.WriteLine(maxValue);
    }


    static void Main(string[] args)
    {
        Node n = new Node();
        n.insertValue(2);
        n.insertValue(22);
        n.insertValue(222);
        n.insertValue(2222);
        n.getMaxValueFromNode();
    }

Raw Text