Create a class list containing class node

Assignment Help Basic Computer Science
Reference no: EM13794794

1. Create a simple linked list program to create a class list containing class node { void *info; node *next; public: node (void *v) {info = v; next = 0; } void put_next (node *n) {next = n;} node *get_next ( ) {return next;} void *get_info ( ) {return info;} }; Be able to initially fill the list. Provide functions to insert/append nodes and remove nodes from the linked list. Be able to display the contents of the list. Write a little driver program with at least 5 values passed in (so that 5 nodes are created) as you insert/append, delete and display data, showing the programs operation. 2. Create a program that uses a derived class based on the list class you've created in the first program. This program will use a stack data type. class node { void *info; node *next; public: node (void *v) {info = v; next = 0; } void put_next (node *n) {next = n;} node *get_next ( ) {return next;} void *get_info ( ) {return info;} }; class list { node *head; int node_num; public: list ( ) { node_num = 0; head = 0;} void remove (int); void insert (void *, int); void append (void * v) {insert (v, node_num + 1); } void *find (int); void display ( ); }; Write functions to push and pop the stack. Write a driver main program which gives 5 values (5 nodes created) that will push, pop and display data stored. 

Reference no: EM13794794

Questions Cloud

Main types of file managers : There are three main types of file managers used in different distributions of Linux. Orthodox file managers or "Commander-like" file managers have three windows (two panels and one command line window).
Using the lifo perpetual inventory method : A company had inventory of 21 units at a cost of $25 each on November 1. On November 2, they purchased 26 units at $26 each. On November 6, they purchased 22 units at $27 each. On November 8, they sold 50 units for $70 each. Using the LIFO perpetual ..
Accessories installed for no charge on their racing craft : What do you debit and credit for a journal entry for this? The rascal bar jetters were billed 303.80 plus sales tax (8%) for accessories installed for no charge on their racing craft.
The customer paid in cash for the work completed : Service and installation work were completed on a customer's jet ski personal watercraft and the customer paid in cash for the work completed. The sales invoice lists 156 for 2.4 hours of labor, 421.40 for accessories, and 8% sales tax on the total.
Create a class list containing class node : 1. Create a simple linked list program to create a class list containing class node { void *info; node *next; public: node (void *v) {info = v; next = 0; } void put_next (node *n) {next = n;} node *get_next ( ) {return next;} void *get_info ( ) {retu..
What is the importance of turnover of accounts receivables : What is the importance of the turnover of Accounts Receivables? Why is it is essential for organizations to keep cash reserves on hands? Is it possible to still bring in a lot of revenue, but still be short on cash?
Ospf messages and icmp messages are directly encapsulated : OSPF messages and ICMP messages are directly encapsulated in an IP data- gram. If we intercept an IP datagram, how can we tell whether the payload belongs to OSPF or ICMP?
Assume average fixed costs : This problem continues the Davis consulting, Inc. situation from Problem P19-40 of chapter 19. Davis Consulting provides consulting service at an average price of $175 per hour and incurs variable cost of $100 per hour. Assume average fixed costs are..
Write a program that reads strings from the user : Write a program that reads strings from the user and writes them to an output file called userStrings.txt.  Stop processing when the user enters the string "DONE".

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Write a method switchpairs that switches the order

Write a method switchPairs that switches the order of elements in a linked list of integers in a pairwise fashion. Your method should switch the order of the first two values, then switch the order of the next two, switch the order of the next two..

  Create a simple movie management system

Create a simple movie management system that manages a list of scheduled movies to be played at a fictitious movie theater. Your program must use of the "list" API in the C++ standard template library (STL).

  Web authoring tools and other software

Web authoring tools and other software

  Which operation following expression will be performed first

Which operation in the following expression will be performed first? c = a++ / b + 5;

  Identify and explore challenges and opportunities

LO2 Identify and explore contemporary challenges and opportunities in information systems and to formulate an opinion or judgement and offer possible solutions.

  Calculate the difference between two numbers

Create a template function that can be used to calculate the difference between two numbers. Make it able to use two integers, two floats, and an integer and a float.

  Description of social-political and economic effects

What role does digital technology play in freedom of speech and democracy.

  The current environment

The current environment doesn't have wireless interface, and the management would like to procure a cutting edge wireless technology infrastructure for the organisation.

  Explain dynamic programming approach-longest weighted path

Assume we have a directed acyclic graph G = (V, E) with real-valued edge weights and two distinguished vertices s and t. Explain a dynamic programming approach for ?nding a longest weighted simple path from s to t.

  Know the industry in which a company operates

Getting to know the industry in which a company operates is a critical factor for leveraging information systems and gaining a competitive advantage.

  Incorporate the method into an application that reads

Incorporate the method into an application that reads two value from the user and displays the result

  Help on pc desk

You are the Chief Information Officer (CIO) of a medium sized business that provides an online data base to Internet subscribers. By then end of the current business quarter, you must propose a design for the implementation of client operating sy..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd