Node
Never
/* 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
-
asdfghjkl
8 min ago
-
asdfghjk
11 min ago
-
Untitled
12 min ago
-
Untitled
39 min ago
-
Untitled
44 min ago
-
Untitled
57 min ago
-
Untitled
1 hour ago
-
Breaking news - Update 1 - 12/10/2023 04:33:34
2 hours ago
-
~@~[[Official!]] Here's How To Watch NFL Week 14 Live Streams@ReddiT at Home?
2 hours ago
-
Breaking news - Update 1 - 12/10/2023 04:26:45
2 hours ago