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 (1 mark)public 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 (4 marks)public MyString (char[] A){}// Create and return a clone of the current instance (5 marks)public object Clone(){}// Compare the current instance of MyString with obj and return a -1,0 or +1// if the current string comes before, at or after obj in alphabetical order (5 marks)public int CompareTo(object obj){}// Return the index of the first occurrence of c; otherwise return -1(2 marks)public int IndexOf(char c){}// Remove all occurrences of c (4 marks)public void Remove (char c){}// Return true if obj is both of type MyString and the same as the current instance;// otherwise return false (2 marks)// Hint: Use CompareTopublic override bool Equals (object obj){}// Print the current instance of MyString (2 marks)public void Print(){}}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!