Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C# I want to run this code without use the System.Collections.Generic library public bool test(x test, x test2) where x : class { return (test

C#

I want to run this code without use the System.Collections.Generic library

image text in transcribed public bool test(x test, x test2) where x : class { return (test == test2); } public void Delete(T value) { Node temp = head; // if (temp != null && temp.Value == value) //if (temp != null && EqualityComparer.Default.Equals(temp.Value, value) == true) if (temp != null && test(temp.Value, value) == true) { head = temp.Next; if (head != null) { head.Previous = null; } return; } // while (temp != null && temp.Value != value) // while (temp != null && EqualityComparer.Default.Equals(temp.Value, value) != true) while (temp != null && test(temp.Value, value) != true) { temp = temp.Next; } if (temp == null) { return; } if (temp.Next != null) { temp.Next.Previous = temp.Previous; } if (temp.Previous != null) { temp.Previous.Next = temp.Next; } }

the node for Generic doubly linked list. And I want to delete function to work with both int and string

2 references public bool test(x test, x test2) where x : class return (test == test2); 2 references public void Delete(t value) Node temp = head; // if (temp != null && temp.Value == value) //if (temp != null && Equality Comparer.Default.Equals(temp.Value, value) == true) if (temp != null && test(temp.Value, value) == true) { head: = temp. Next; if (head != null) { head. Previous = null; } return; } // while (temp != null && temp.Value != value) // while (temp != null && Equality Comparer.Default.Equals(temp.Value, value) != true) while (temp != null && test(temp.Value, value) != true) { temp = temp. Next; if (temp == null) return; if (temp. Next != null) temp. Next. Previous = temp. Previous; if (temp. Previous != null) temp. Previous. Next = temp. Next; 2 references public bool test(x test, x test2) where x : class return (test == test2); 2 references public void Delete(t value) Node temp = head; // if (temp != null && temp.Value == value) //if (temp != null && Equality Comparer.Default.Equals(temp.Value, value) == true) if (temp != null && test(temp.Value, value) == true) { head: = temp. Next; if (head != null) { head. Previous = null; } return; } // while (temp != null && temp.Value != value) // while (temp != null && Equality Comparer.Default.Equals(temp.Value, value) != true) while (temp != null && test(temp.Value, value) != true) { temp = temp. Next; if (temp == null) return; if (temp. Next != null) temp. Next. Previous = temp. Previous; if (temp. Previous != null) temp. Previous. Next = temp. Next

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases And Information Systems 1 International Baltic Conference Dbandis 2020 Tallinn Estonia June 19 2020 Proceedings

Authors: Tarmo Robal ,Hele-Mai Haav ,Jaan Penjam ,Raimundas Matulevicius

1st Edition

303057671X, 978-3030576714

More Books

Students also viewed these Databases questions

Question

2. To compare the costs of alternative training programs.

Answered: 1 week ago