Question: please help c# Question 5 Please note that parts A, B, and C of the Linked Lists: Reading Code are different parts of the same
please help c#
Question 5 Please note that parts A, B, and C of the "Linked Lists: Reading Code are different parts of the same question. You must use the same code (from Part A) to answer all three parts Given the following code: class LinkedListNode { // public data members bad, but allowed (for brevity on exam) public int key; // sometimes called "data" public LinkedlistNode next; public void Print { if(this.next !- null) Console.WriteLine("LLNode: data-{0} next:{1}", key, this.next.key); else Console.WriteLine("LLNode: data-{0} next:null", key); class LL { LinkedlistNode first; public void MysteryFunction() { int i 0; LinkedListNode temp = first; while (temp != null) { Console.WriteLine("{0}: ", i); temp.Print: temp - temp. next; temp-temp.next; 3 // You can assume that methods like Add, etc, are implemented // but left out for clarity } } LL Object LinkedNode first memory rot LinkedListNode Object int key LinkedistNode next memory LinkedListNode Object LinkedListNode Object ind key LinkedlistNodenent memory of tyret Linkediste nest memoryrup LinkedListNode Object int key LinkedlistNode nest memory rul LinkedlistNode Object int key LinkedlistNode next memory - LinkedListNode Object int key 17 Linkedstenest What will be printed to the screen when MysteryFunction is called? You may assume that the above picture accurately represents the list that has been constructed, previous to the call. Question 6 9 pts What is the running time (in Big "Oh" notation) for the MysteryFunction method that was shown in the previous question ("Linked Lists: Reading Code: PARTA")? Edit View Insert Format Tools Table 12pt Paragraph BIU ALT? O words Question 7 9 pts Question 5 Please note that parts A, B, and C of the "Linked Lists: Reading Code are different parts of the same question. You must use the same code (from Part A) to answer all three parts Given the following code: class LinkedListNode { // public data members bad, but allowed (for brevity on exam) public int key; // sometimes called "data" public LinkedlistNode next; public void Print { if(this.next !- null) Console.WriteLine("LLNode: data-{0} next:{1}", key, this.next.key); else Console.WriteLine("LLNode: data-{0} next:null", key); class LL { LinkedlistNode first; public void MysteryFunction() { int i 0; LinkedListNode temp = first; while (temp != null) { Console.WriteLine("{0}: ", i); temp.Print: temp - temp. next; temp-temp.next; 3 // You can assume that methods like Add, etc, are implemented // but left out for clarity } } LL Object LinkedNode first memory rot LinkedListNode Object int key LinkedistNode next memory LinkedListNode Object LinkedListNode Object ind key LinkedlistNodenent memory of tyret Linkediste nest memoryrup LinkedListNode Object int key LinkedlistNode nest memory rul LinkedlistNode Object int key LinkedlistNode next memory - LinkedListNode Object int key 17 Linkedstenest What will be printed to the screen when MysteryFunction is called? You may assume that the above picture accurately represents the list that has been constructed, previous to the call. Question 6 9 pts What is the running time (in Big "Oh" notation) for the MysteryFunction method that was shown in the previous question ("Linked Lists: Reading Code: PARTA")? Edit View Insert Format Tools Table 12pt Paragraph BIU ALT? O words Question 7 9 pts
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
