Write a program to implement the functions on linked lists

Assignment Help Data Structure & Algorithms
Reference no: EM13974464

1. Write a program to implement the following functions on linked lists. Assume that node structure of a singly linked list is as follows.

struct node
{
int info;
struct node *next;
};
typedef struct node node;

and node structure of a doubly linked list is as follows

struct cnode
{
int info;
struct cnode *next; struct cnode *previous;
};
typedef struct cnode cnode;

Implement the below functions whose prototypes are given below

node *CopytoSinglyLinked(cnode *head) node *Previous(node *head, node *current) void PrintReverse(node *head)
node *RemoveDuplicates(node *head)

• CopytoSinglyLinked function makes a singly linked copy of a doubly linked list that is provided as a parameter and returns a pointer to the singly linked list.

• Previous function returns the previous node of current in a singly linked list pointed by head. If current is the first node Previous returns null.

• PrintReverse function prints a elements of a singly linked list in reverse order. This should be implemented as an iterative function. Use Previous function in your imple- mentation.

• RemoveDuplicates function removes duplicate elements in a singly linked list that is provided as a parameter. The contents of the list need not be sorted. You should remove duplicates in an unsorted list without changing the order of elements in the list.

Reference no: EM13974464

Questions Cloud

Calculate gross patient revenue and deductions : Calculate Gross patient revenue and deductions from gross patient revenue. Define fee for service, discounted fee for service, charity services, and payment before service is delivered.
In what ways you anticipate holding your reader''s attention : What strategy do you think you'll use to construct an introduction?
Why and how the boarding schools came into existence : Explain how the authors' work and life experiences would have influenced their decisions to take a stand against boarding schools. Then Interpret the quotes explain what they mean.
Title is surprise findings : Title is Surprise Findings.  By the end of this activity you will be able to: Demonstrate an understanding of individual and group differences and alliances and explain how they may be influenced by Race, Gender, Sexual orientation, age class, religi..
Write a program to implement the functions on linked lists : Write a program to implement the functions on linked lists. Assume that node structure of a singly linked list -
Supervisor that analyzes fesiability : It should follow American Psychological Association (APA) documentation style and include a minimum of eight sources (at least five of which are academic secondary sources).
Findings reported in the aarp article : Data providing the weekly pay for a sample of 50 working women are available in the file named WeeklyPay. These data are consistent with the findings reported in the AARP article.
Family regularly consumes : Staple products like milk ,bread,eggs ,butter which are bought routinely because the family regularly consumes them ,Is true or false?
Problem regarding the complementary systems : Leadership and management are two distinct but complementary systems. While managers promote stability, leaders press for change. explain what the statement mean with an aid of a practical example

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Creating sample spreadsheet for household budget

You do not need to put in personal data or actual values if you do not wish, but you must include some information for each of the various categories and income and expense line items.

  What are advantages of using linked list instead of a vector

What is the difference between a class template and a template class? What are the advantages and disadvantages of using a linked list instead of a vector?

  Describe ways to generalize a simple sorting algorithm

Describe ways to generalize a simple sorting algorithm (such as insertion sort, or any other sort you are familiar with) to support this generalization

  List of common data structures

Make a list of some of the common data structures provided by C#. You should have a minimum of 4 different data types.

  Algorithm to recognize substrings which form numbers

Given the string of numbers, recognize all the substrings which form numbers which are divisible by 3. For instance, applying algorithm on the string.

  Draw a red-black tree

Draw a red-black tree for the following values inserted in this order. Illustrate each operation that occurs: w k o s y t p r

  What is the logarithm base-2 of zero? of one

What is the logarithm base-2 of zero? of one?

  Factors-principles considering indecency regulation issues

What factors and principles should the federal government take into account when considering indecency regulation issues?

  What are entity-relationship diagrams

What are entity-relationship diagrams, and how are they used? Discuss the ethical issues to consider when planning a database.

  Divide-and-conquer two-dimensional closest-pair algorithm

Suppose the version of the divide-and-conquer two-dimensional closest-pair algorithm in which, instead of presorting input set P, we simply sort each of the two sets Pl and Pr in nondecreasing order of their y coordinates on each recursive call.

  Transmitting image using raster scan order

If we were to transmit this image using raster scan order, after 15 seconds how many rows of the image will the user have received?

  Open addressing with double hashing where second hash funcn

Given the input {3810, 8832, 8653, 2863, 3580, 8440, 1941, 4290, 8805, 7400}

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