Question: Make this java code C please, thanks. Edited: /static void main must be defined in a public class import java.util. NoSuchElementException; public class SortedListRefBased private
Make this java code C please, thanks. Edited:





/"static void main" must be defined in a public class import java.util. NoSuchElementException; public class SortedListRefBased private SortedNode head; private int numberOfItems; public SortedListRefBased() head null; /init head variable numberOfItemse; //init numitem public void createsortedList) head null; numberOfItems ; public boolean sortedIsEmpty ) return (numberOfItems0) public int sortedSize() return numberOfItems; public void sortedAdd (Object item) if (numberOfItems)//create new node as head head -new SortedNode(item); elset //find appropriate place to insert new node SortedNode prev null; SortedNode curr-head; while(currnull && ((Comparable)item).compareTo(curr.item e)( prev -curr; curr-curr.next; if(prevnull) //verify if previous node null //if is then insert new node at first head = new SortedNode(item, head); elset //if previous-null then isnert somewhere else prev.next- new SortedNode (item, curr); numberOfItems++
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
