Linked listsnbspalong with vectors linked lists are one of

Assignment Help C/C++ Programming
Reference no: EM13371184

Linked Lists 

Along with vectors, linked lists are one of the fundamental data structures in computer science. Unlike vectors, which store information in a contiguous block of computer memory, linked lists have the potential to store information in non-adjacent memory blocks. In this lab, you will write a very basic doubly-linked list. To complete this lab, you will need to have created the appropriate .h and .c files that

implement the following struct and functions: 

typedef struct IntList_t 

 int value; 

 struct IntList_t *previous; 

 struct IntList_t *next; 

} IntList_t; 

 

IntList_t* intList_init(int starting_value) 

Like our vector's init function, the LL version must dynamically create a new IntList_t and set its starting value as well as setting the previous and next pointers to NULL. 

IntList_t * intList_rewind(IntList_t *some_list) 

This function returns a pointer to the "beginning" of the linked list. For our purposes, we will consider the beginning of a linked list to be represented by the IntList_t whose previous pointer is equal to NULL. 

void intList_add(IntList_t *some_list, int value) 

This function will add a new IntList_t to the end of the current linked list. Note that for our purposes, the last element in the list is represented by the individual IntList_t whose next pointer is equal to NULL. 

void intList_remove(IntList_t *some_list) 

This function removes the supplied IntList_t from the current chain of list items. 

void intList_free(IntList_t *some_list) 

Freeing up dynamic memory allocated for a linked list is a little more work than freeing up dynamic memory for a vector. As such, this function should call free on every node in the linked list. 

Sample Output 

To test these methods, you must write a simple test driver in your main function. Here is an example of my test driver:  

2065_sample_output.png

Reference no: EM13371184

Questions Cloud

Computer platformscomputer systems may be classified into : computer platformscomputer systems may be classified into two categories classical and quantum. this assignment will
Explore the role of the epigenome andor other gene : explore the role of the epigenome andor other gene expression regulatory mechanisms in the development of cancer.nbsp
Answer below questions based onnbspisraelrsquos exodus and : answer below questions based onnbsp?israelrsquos exodus and themes of deliverance?read exodus 19-20question 1 identify
1nbspnbspnbspabnormal returnscolumn a below shows the : 1.nbspnbspnbspabnormal returnscolumn a below shows the monthly return on the british ftse 100 index from may 2007
Linked listsnbspalong with vectors linked lists are one of : linked listsnbspalong with vectors linked lists are one of the fundamental data structures in computer science. unlike
Advertising technologies inc ati specializes in providing : advertising technologies inc. ati specializes in providing both published and online advertising services for the
Describe an algorithm to play the game of nim using all of : describe an algorithm to play the game of nim using all of the three tools discussed in class pseudocode flowchart
Thermometry is the science of temperature measurementnbsp : thermometry is the science of temperature measurement.nbsp for a thermometer to work we infer the temperature from the
Valuation case - andrew hawks founder of a caribbean based : valuation case - andrew hawks founder of a caribbean based start-up firm nabr publishing ltd. just completed

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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