Question
C++ help
0.1. An ordered linked list of characters has been constructed using the array-based implementation. The following diagram sh
Show the changes in the data and next members of the array and the values of first and free after the letter G is inserted in
0 0
Add a comment Improve this question Transcribed image text
Answer #1
  1. The order of the original list

(First)   B   --> D --> F --> I --> T --> (tail)

  1. When you insert G, first we have to find a place in the list

Current list (First)   B   --> D --> F --> I -->  T --> (tail)

Free List                    X --> P --> M --> (tail)

Place for G would be in between F & I node. So we will use Head node of free list and insert it in between F & I and update the data value to G. and head of the free list will be moved to P.

List after insertion of G (First)   B   --> D --> F --> G --> I -->   T --> (tail)

Free List would start from P.                   P --> M --> (tail)

Tabular representation as shown in question would be as below for new list:

Node Next Data F 9 -1 1 T P 3 Free =2 3 М -1 4 1 First 5 B 7 G 4 7 0

In case of any query do comment. Please rate your answer. Thanks

Add a comment
Know the answer?
Add Answer to:
C++ help 0.1. An ordered linked list of characters has been constructed using the array-based implementation....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Suppose a linked list (implemented using the array implementation) is ordered by the ABC123 ID and...

    Suppose a linked list (implemented using the array implementation) is ordered by the ABC123 ID and a node is represented by the following Node definition: #define MAX NODES 100 tvpedef struct shac. szAbc1231d[7]: double dGPA; int iNext: Node; Node nodeMIMAX NODES]; int iHead; int ifind, iBest, iPrecedes; // assume the linked list has been populated with values and // iHead points to the first node in that array. // practice problem #1- sample invocation iFind searchLL(nodeM, iHead, "XYZ321", &iprecedes): if...

  • Any help with this is appriciated Array-Based Linked List Implementation Implement an array-based Linked List in...

    Any help with this is appriciated Array-Based Linked List Implementation Implement an array-based Linked List in Java. Use your Use your Can class as a JAR. You need to create a driver that makes several cans and places them in alphabetical order in a list. Identify the necessary methods in a List Linked implementation. Look at previous Data Structures (stack or queue) and be sure to include all necessary methods. DO NOT USE Java's List. You will receive zero points....

  • a. Using C++, define a node structure of the linked list (e.g. value is an integer,...

    a. Using C++, define a node structure of the linked list (e.g. value is an integer, next is a node type pointer), construct a linked list of 10 nodes and assign random numbers as the nodes’ values. Use loop to track and print from the first node to the last and output all nodes’ values. Finally, free all memories of the linked list.

  • 16 and 18 C++ 11. Given the dynamic linked implementation of a linked list shown below,...

    16 and 18 C++ 11. Given the dynamic linked implementation of a linked list shown below, write expressions that do the following, assuming that currPtr is somewhere in the middle of the list: a. Access the component member of the first list element. b. Advance currPtr to point to the next element. c. Access the component member of the next element (the one that follows the current element). d. Access the component member of the element that follows the next...

  • Extend Linked List in C // Exercise 5 /* Parameter head points to the first node in a linked list, or is * NULL if the l...

    Extend Linked List in C // Exercise 5 /* Parameter head points to the first node in a linked list, or is * NULL if the list is empty. * * Parameter other points to the first node in a linked list, or is * NULL if the list is empty. * * Extend the linked list pointed to by head so that it contains * copies of the values stored in the linked list pointed to by other. *...

  • Create a linked list of at least 15 different values that are prompted for and entered...

    Create a linked list of at least 15 different values that are prompted for and entered while the program is running. Appending a node attaches that node to the end of the list while inserting a node places it in order maintaining a sorted list. Create a menu driven program where you have the options to appended, insert, display, and delete a node. Display the list after first appending data showing it in no specific order, delete all nodes and...

  • ***CODE MUST BE IN C++*** Using the linked list in "basic linked list" which has a...

    ***CODE MUST BE IN C++*** Using the linked list in "basic linked list" which has a STRUCTURE for each node, write FUNCTION which starts at the head and outputs the value for each node until the last node is reached. Note: your function should work with the structure that is in this program. Please do not use the example which is for a class, but this example canbe helkpful.  Also note that the function must work no matter how many nodes...

  • Using the provided table interface table.h and the sample linked list code linkedList.c, complete an implementation...

    Using the provided table interface table.h and the sample linked list code linkedList.c, complete an implementation of the Table ADT. Make sure that you apply the concepts of design by contract (DbC) to your implementation. Once you have fully implemented the table, create a main.c file that implements a testing framework for your table. Your table implementation must ensure that values inserted are unique, and internally sorted within a linked list. table.h #ifndef _TABLE_H #define _TABLE_H //----------------------------------------------------------------------------- // CONSTANTS AND...

  • ch 6 ex 14 lists plus, c++ plus data structures, linked list understanding Problem: Use the...

    ch 6 ex 14 lists plus, c++ plus data structures, linked list understanding Problem: Use the linked lists contained in the array pictures in figure 6.19 (see pics) to amswer the following questions : please show some explanation / work so that i can grasp and retain this information Thank you so much for your time! 14. Use the linked lists contained in the array pictured in Figure 6.19 to answer the following questions: a. What elements are in the...

  • C++ program, item.cpp implementation. Implementation: You are supposed to write three classes, called Item, Node and In...

    C++ program, item.cpp implementation. Implementation: You are supposed to write three classes, called Item, Node and Inventory respectively Item is a plain data class with item id, name, price and quantity information accompanied by getters and setters Node is a plain linked list node class with Item pointer and next pointer (with getters/setters) Inventory is an inventory database class that provides basic linked list operations, delete load from file / formatted print functionalities. The majority of implementation will be done...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT