Question: Complete the MyString class that is partially defined below.public class MyString : ICloneable, IComparable { private class Node { public char item;public Node next; /
Complete the MyString class that is partially defined below.public class MyString : ICloneable, IComparable private class Node public char item;public Node next; Constructor markpublic Node private Node front; Reference to the first header nodeprivate int length; Number of characters Initialize an instance of MyString based on the given character array A markspublic MyString char A Create and return a clone of the current instance markspublic object Clone Compare the current instance of MyString with obj and return a or if the current string comes before, at or after obj in alphabetical order markspublic int CompareToobject obj Return the index of the first occurrence of c; otherwise return markspublic int IndexOfchar c Remove all occurrences of c markspublic void Remove char c Return true if obj is both of type MyString and the same as the current instance; otherwise return false marks Hint: Use CompareTopublic override bool Equals object obj Print the current instance of MyString markspublic void Print
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
