Trying to Incorporate Find function but teek getting warnings that Type T cannot be comfirmed as a reference type. (Could be a struct) Need to find oput why it is affecting BST but not Linked List etc...

This commit is contained in:
Luke Else 2022-04-10 22:27:56 +01:00
parent 735bf68e0d
commit 702b251a8a
3 changed files with 9 additions and 5 deletions

View File

@ -48,9 +48,11 @@ namespace C_.Datastructures.BinarySearchTree
}
public bool Find(T value){
var x = Descend(value, Root);
return true;
public bool Find(T? value){
if (Root.Value != default || Root.Value == value)
{
}
}
private TreeNode<T>? Descend(T value, TreeNode<T>? current)

View File

@ -6,7 +6,7 @@ using C_.Datastructures.Generic;
namespace C_.Datastructures.BinarySearchTree
{
internal class TreeNode<T>:DirectedNode<T, TreeNode<T>>
internal class TreeNode<T> : DirectedNode<T, TreeNode<T>>
{
//All properties inherited from base class
public static TreeNode<T> Create(T? value){

View File

@ -1,4 +1,6 @@
namespace C_.Datastructures.Generic
using System.Collections.Generic;
namespace C_.Datastructures.Generic
{
abstract internal class UndirectedNode<T, NodeType>
{//Generic Node type that every other type inherits from