SlideShare a Scribd company logo
Using visual studio 2022, a C# windows form application, and your DoubleLinkedClass and
DoubleLinkedNode classes from project 5, implement a DequeueClass, a StackClass, and a
QueueClass. Do not use any arrays, lists, dictionaries, or other built in data structures, only
instances of your linkedLists classes from project 5. The dequeue class needs to contain a
reference to an instance of your DoubleLinkedList class, with the QueueClass and StackClass
inheriting from the Dequeue class. Your Stack and Queue pop and push need to be one-line calls
to the Dequeue popLeft, pushLeft, popRight, pushRight. Do not copy the code from the dequeue
class to implement the Stack and Queue.
DoubleLinkedClasses From2263Project5
internal class DoubleLinkedList<T>
{
public DoubleLinkedListNode<T> firstNode = null;
public DoubleLinkedListNode<T> lastNode = null;
public DoubleLinkedListNode<T> currentNode = null;
public int nodeNumber = 0;
public DoubleLinkedList()
{
}
// creates first node in list with firstValue
public DoubleLinkedList(T firstValue)
{
firstNode = new DoubleLinkedListNode<T>(firstValue);
lastNode = firstNode;
currentNode = firstNode;
nodeNumber = 1;
}
public DoubleLinkedListNode<T> GetCurrentNode()
{
return currentNode;
}
public void InsertFirst(T value)
{
DoubleLinkedListNode<T> newNode = new DoubleLinkedListNode<T>(value);
if (firstNode == null)
{
firstNode = newNode;
lastNode = firstNode;
currentNode = firstNode;
}
else
{
newNode.next = firstNode;
firstNode.previous = newNode;
firstNode = newNode;
currentNode = firstNode;
}
nodeNumber++;
}
public void InsertBeforeFirst(T value)
{
if (firstNode == null)
{
InsertFirst(value);
return;
}
DoubleLinkedListNode<T> newNode = new DoubleLinkedListNode<T>(value);
newNode.next = firstNode;
firstNode.previous = newNode;
firstNode = newNode;
nodeNumber++;
}
public void InsertAfterLast(T value)
{
if (lastNode == null)
{
InsertFirst(value);
return;
}
DoubleLinkedListNode<T> newNode = new DoubleLinkedListNode<T>(value);
lastNode.next = newNode;
newNode.previous = lastNode;
lastNode = newNode;
currentNode = lastNode;
nodeNumber++;
}
public void InsertAfterCurrent(T value)
{
if (currentNode == null)
{
InsertFirst(value);
return;
}
DoubleLinkedListNode<T> newNode = new DoubleLinkedListNode<T>(value);
newNode.next = currentNode.next;
newNode.previous = currentNode;
if (currentNode.next != null)
{
currentNode.next.previous = newNode;
}
currentNode.next = newNode;
currentNode = newNode;
if (lastNode == currentNode.previous)
{
lastNode = currentNode;
}
nodeNumber++;
}
public int NumberOfNodesInList()
{
return nodeNumber;
}
public void DeleteFirst()
{
if (firstNode == null)
{
return;
}
if (firstNode.next == null)
{
firstNode = null;
lastNode = null;
currentNode = null;
}
else
{
firstNode = firstNode.next;
firstNode.previous = null;
currentNode = firstNode;
}
nodeNumber--;
}
public void DeleteLast()
{
if (lastNode == null)
{
return;
}
if (lastNode.previous == null)
{
firstNode = null;
lastNode = null;
currentNode = null;
}
else
{
lastNode = lastNode.previous;
lastNode.next = null;
currentNode = lastNode;
}
nodeNumber--;
}
public void DeleteCurrent()
{
if (currentNode == null)
{
return;
}
if (currentNode.previous == null)
{
DeleteFirst();
return;
}
if (currentNode.next == null)
{
DeleteLast();
return;
}
currentNode.previous.next = currentNode.next;
currentNode.next.previous = currentNode.previous;
currentNode = currentNode.next;
nodeNumber--;
}
public void MoveToNext()
{
if (currentNode == null || currentNode.next == null)
{
return;
}
currentNode = currentNode.next;
}
public void MoveToPrevious()
{
if (currentNode == null || currentNode.previous == null)
{
return;
}
currentNode = currentNode.previous;
}
public DoubleLinkedListNode<T> Find(T value)
{
return FindRecursive(firstNode, value);
}
private DoubleLinkedListNode<T> FindRecursive(DoubleLinkedListNode<T> node, T value)
{
if (node == null)
{
return null;
}
if (node.value.Equals(value))
{
return node;
}
return FindRecursive(node.next, value);
}
public string GetDisplayString()
{
if (firstNode == null)
{
return "";
}
return GetDisplayStringRecursive(firstNode);
}
private string GetDisplayStringRecursive(DoubleLinkedListNode<T> node)
{
if (node == null)
{
return "";
}
string result = node.value.ToString() + " ";
result += GetDisplayStringRecursive(node.next);
return result;
}
}
internal class DoubleLinkedListNode<T>
{
public T value;
public DoubleLinkedListNode<T> next = null;
public DoubleLinkedListNode<T> previous = null;
public DoubleLinkedListNode(T value)
{
this.value = value;
previous = null;
next = null;
}
private DoubleLinkedListNode()
{
value = default(T);
}
}
Develop a test harness, that allows testing rapid, but effective testing of your classes, including
inserting and deleting 6 or more integers, including completely filling, completely emptying, and
then refilling your data structures
Using visual studio 2022- a C# windows form application- and your Doub.pdf

More Related Content

PPT
Data structures cs301 power point slides lecture 03
PPT
computer notes - Data Structures - 3
PDF
Can someone help me to fix the code please package dlist i.pdf
PDF
Write a program to implement below operations with both singly and d.pdf
PDF
Create a new java class called ListNode. Implement ListNode as a gen.pdf
PDF
fix the error - class Node{ int data- Node next-.pdf
PPTX
Data Structures and Agorithm: DS 05 Doubly Linked List.pptx
PDF
Assignment isPage 349-350 #4 and #5 Use the Linked List lab.pdf
Data structures cs301 power point slides lecture 03
computer notes - Data Structures - 3
Can someone help me to fix the code please package dlist i.pdf
Write a program to implement below operations with both singly and d.pdf
Create a new java class called ListNode. Implement ListNode as a gen.pdf
fix the error - class Node{ int data- Node next-.pdf
Data Structures and Agorithm: DS 05 Doubly Linked List.pptx
Assignment isPage 349-350 #4 and #5 Use the Linked List lab.pdf

Similar to Using visual studio 2022- a C# windows form application- and your Doub.pdf (20)

PDF
So I have this code(StackInAllSocks) and I implemented the method but.pdf
PDF
.NET 2015: Будущее рядом
DOCX
Need help finishing this doubly linked list code- Commented lines are.docx
PDF
In the class we extensively discussed a node class called IntNode in.pdf
DOCX
I need help coding a doubly linked list from this unfinished code- Eve.docx
PDF
I need help implementing a Stack with this java programming assignme.pdf
PDF
Add delete at a position to the code and display it to the code- class.pdf
PDF
Help I keep getting the same error when running a code. Below is the.pdf
PPTX
C# Generics
PDF
DoublyList-cpp- #include -DoublyList-h- using namespace std- void Doub.pdf
PDF
C# code pleaseWrite a program that creates a link list object of 1.pdf
PPTX
CSharp v1.0.2
PDF
Lab-2.4 101.pdf
DOCX
For this micro assignment, you must implement two Linked List functi.docx
PDF
could you implement this function please, im having issues with it..pdf
PDF
import java-util-Iterator- import java-util-NoSuchElementException- im.pdf
PDF
import java-util--- public class MyLinkedList{ public static void.pdf
PPTX
Effective C#
DOCX
Linked Stack program.docx
PDF
Please help write BinaryTree-java Thank you! Create a class BinaryTr.pdf
So I have this code(StackInAllSocks) and I implemented the method but.pdf
.NET 2015: Будущее рядом
Need help finishing this doubly linked list code- Commented lines are.docx
In the class we extensively discussed a node class called IntNode in.pdf
I need help coding a doubly linked list from this unfinished code- Eve.docx
I need help implementing a Stack with this java programming assignme.pdf
Add delete at a position to the code and display it to the code- class.pdf
Help I keep getting the same error when running a code. Below is the.pdf
C# Generics
DoublyList-cpp- #include -DoublyList-h- using namespace std- void Doub.pdf
C# code pleaseWrite a program that creates a link list object of 1.pdf
CSharp v1.0.2
Lab-2.4 101.pdf
For this micro assignment, you must implement two Linked List functi.docx
could you implement this function please, im having issues with it..pdf
import java-util-Iterator- import java-util-NoSuchElementException- im.pdf
import java-util--- public class MyLinkedList{ public static void.pdf
Effective C#
Linked Stack program.docx
Please help write BinaryTree-java Thank you! Create a class BinaryTr.pdf
Ad

More from acteleshoppe (20)

PDF
Using your understanding of Hardy-Weinberg proportions- which of the f.pdf
PDF
Using the summary table above- match the sources of variation with the.pdf
PDF
Using PowerPoint draft an academic poster critically analysing and ill.pdf
PDF
Using the life cycle image above to help you define meiosis- haplece a.pdf
PDF
Using the Influence tactic known as pressure usually Involves Multiple.pdf
PDF
Using the information below- please prepare the 2020 and 2021 Balance.pdf
PDF
Using the following national income accounting data- compute (a) GDP-.pdf
PDF
Using the company Netflix- Based on your prior research- determine.pdf
PDF
Using the code below- I need help with creating code for the following.pdf
PDF
Using the code below- I need help with the following 3 things- 1) Writ.pdf
PDF
Using the assigned class reading- -SOCIAL CONTROL THEORIES OF URBAN PO.pdf
PDF
Using the areas in Figure (the Empirical Rule)- find the areas between.pdf
PDF
Using sources from the Internet- identify some of the problems facing.pdf
PDF
Using Python- Prompt the user to enter a word and a single character-.pdf
PDF
Using putty with Bash shell- I am trying to complete the following-.pdf
PDF
Using linux - For each environment variable below- state whether it is.pdf
PDF
Using Java and the parboiled Java library Write a BNF grammar for the.pdf
PDF
using basic python P4-16 Factoring of integers- Write a program that a.pdf
PDF
using C# language- a WPF application will be made with the application.pdf
PDF
Using a waterfall framework is suitable for a project involving which.pdf
Using your understanding of Hardy-Weinberg proportions- which of the f.pdf
Using the summary table above- match the sources of variation with the.pdf
Using PowerPoint draft an academic poster critically analysing and ill.pdf
Using the life cycle image above to help you define meiosis- haplece a.pdf
Using the Influence tactic known as pressure usually Involves Multiple.pdf
Using the information below- please prepare the 2020 and 2021 Balance.pdf
Using the following national income accounting data- compute (a) GDP-.pdf
Using the company Netflix- Based on your prior research- determine.pdf
Using the code below- I need help with creating code for the following.pdf
Using the code below- I need help with the following 3 things- 1) Writ.pdf
Using the assigned class reading- -SOCIAL CONTROL THEORIES OF URBAN PO.pdf
Using the areas in Figure (the Empirical Rule)- find the areas between.pdf
Using sources from the Internet- identify some of the problems facing.pdf
Using Python- Prompt the user to enter a word and a single character-.pdf
Using putty with Bash shell- I am trying to complete the following-.pdf
Using linux - For each environment variable below- state whether it is.pdf
Using Java and the parboiled Java library Write a BNF grammar for the.pdf
using basic python P4-16 Factoring of integers- Write a program that a.pdf
using C# language- a WPF application will be made with the application.pdf
Using a waterfall framework is suitable for a project involving which.pdf
Ad

Recently uploaded (20)

PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PPTX
Cell Types and Its function , kingdom of life
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Lesson notes of climatology university.
PDF
RMMM.pdf make it easy to upload and study
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
Presentation on HIE in infants and its manifestations
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
Supply Chain Operations Speaking Notes -ICLT Program
Chinmaya Tiranga quiz Grand Finale.pdf
Cell Types and Its function , kingdom of life
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
Module 4: Burden of Disease Tutorial Slides S2 2025
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Lesson notes of climatology university.
RMMM.pdf make it easy to upload and study
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Presentation on HIE in infants and its manifestations
O5-L3 Freight Transport Ops (International) V1.pdf
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
Final Presentation General Medicine 03-08-2024.pptx
Microbial diseases, their pathogenesis and prophylaxis
Pharmacology of Heart Failure /Pharmacotherapy of CHF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
STATICS OF THE RIGID BODIES Hibbelers.pdf
Anesthesia in Laparoscopic Surgery in India
Supply Chain Operations Speaking Notes -ICLT Program

Using visual studio 2022- a C# windows form application- and your Doub.pdf

  • 1. Using visual studio 2022, a C# windows form application, and your DoubleLinkedClass and DoubleLinkedNode classes from project 5, implement a DequeueClass, a StackClass, and a QueueClass. Do not use any arrays, lists, dictionaries, or other built in data structures, only instances of your linkedLists classes from project 5. The dequeue class needs to contain a reference to an instance of your DoubleLinkedList class, with the QueueClass and StackClass inheriting from the Dequeue class. Your Stack and Queue pop and push need to be one-line calls to the Dequeue popLeft, pushLeft, popRight, pushRight. Do not copy the code from the dequeue class to implement the Stack and Queue. DoubleLinkedClasses From2263Project5 internal class DoubleLinkedList<T> { public DoubleLinkedListNode<T> firstNode = null; public DoubleLinkedListNode<T> lastNode = null; public DoubleLinkedListNode<T> currentNode = null; public int nodeNumber = 0; public DoubleLinkedList() { } // creates first node in list with firstValue public DoubleLinkedList(T firstValue) { firstNode = new DoubleLinkedListNode<T>(firstValue); lastNode = firstNode; currentNode = firstNode; nodeNumber = 1; } public DoubleLinkedListNode<T> GetCurrentNode() { return currentNode; } public void InsertFirst(T value) { DoubleLinkedListNode<T> newNode = new DoubleLinkedListNode<T>(value); if (firstNode == null) { firstNode = newNode; lastNode = firstNode;
  • 2. currentNode = firstNode; } else { newNode.next = firstNode; firstNode.previous = newNode; firstNode = newNode; currentNode = firstNode; } nodeNumber++; } public void InsertBeforeFirst(T value) { if (firstNode == null) { InsertFirst(value); return; } DoubleLinkedListNode<T> newNode = new DoubleLinkedListNode<T>(value); newNode.next = firstNode; firstNode.previous = newNode; firstNode = newNode; nodeNumber++; } public void InsertAfterLast(T value) { if (lastNode == null) { InsertFirst(value); return; } DoubleLinkedListNode<T> newNode = new DoubleLinkedListNode<T>(value); lastNode.next = newNode; newNode.previous = lastNode; lastNode = newNode; currentNode = lastNode; nodeNumber++; } public void InsertAfterCurrent(T value)
  • 3. { if (currentNode == null) { InsertFirst(value); return; } DoubleLinkedListNode<T> newNode = new DoubleLinkedListNode<T>(value); newNode.next = currentNode.next; newNode.previous = currentNode; if (currentNode.next != null) { currentNode.next.previous = newNode; } currentNode.next = newNode; currentNode = newNode; if (lastNode == currentNode.previous) { lastNode = currentNode; } nodeNumber++; } public int NumberOfNodesInList() { return nodeNumber; } public void DeleteFirst() { if (firstNode == null) { return; } if (firstNode.next == null) { firstNode = null; lastNode = null; currentNode = null; } else { firstNode = firstNode.next; firstNode.previous = null; currentNode = firstNode; }
  • 4. nodeNumber--; } public void DeleteLast() { if (lastNode == null) { return; } if (lastNode.previous == null) { firstNode = null; lastNode = null; currentNode = null; } else { lastNode = lastNode.previous; lastNode.next = null; currentNode = lastNode; } nodeNumber--; } public void DeleteCurrent() { if (currentNode == null) { return; } if (currentNode.previous == null) { DeleteFirst(); return; } if (currentNode.next == null) { DeleteLast(); return; } currentNode.previous.next = currentNode.next; currentNode.next.previous = currentNode.previous; currentNode = currentNode.next;
  • 5. nodeNumber--; } public void MoveToNext() { if (currentNode == null || currentNode.next == null) { return; } currentNode = currentNode.next; } public void MoveToPrevious() { if (currentNode == null || currentNode.previous == null) { return; } currentNode = currentNode.previous; } public DoubleLinkedListNode<T> Find(T value) { return FindRecursive(firstNode, value); } private DoubleLinkedListNode<T> FindRecursive(DoubleLinkedListNode<T> node, T value) { if (node == null) { return null; } if (node.value.Equals(value)) { return node; } return FindRecursive(node.next, value); } public string GetDisplayString() { if (firstNode == null)
  • 6. { return ""; } return GetDisplayStringRecursive(firstNode); } private string GetDisplayStringRecursive(DoubleLinkedListNode<T> node) { if (node == null) { return ""; } string result = node.value.ToString() + " "; result += GetDisplayStringRecursive(node.next); return result; } } internal class DoubleLinkedListNode<T> { public T value; public DoubleLinkedListNode<T> next = null; public DoubleLinkedListNode<T> previous = null; public DoubleLinkedListNode(T value) { this.value = value; previous = null; next = null; } private DoubleLinkedListNode() { value = default(T); } } Develop a test harness, that allows testing rapid, but effective testing of your classes, including inserting and deleting 6 or more integers, including completely filling, completely emptying, and then refilling your data structures