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

  Finding equation has no solutions mod m

Let the equation ax = b mod m, where x is unknown and a, b and m are given. Illustrate that this equation has either no solutions mod m, or d solutions mod m.

  Write a method that finds the average age of the students

Write a method that finds the average age of the students stored in the data structure and some Java code that could be used in a test program to display the value returned by the method on the console or command prompt.

  Determining ciphertext generated by encryption

Determine ciphertext (in binary form) generated by encryption of character X?

  Determine computational complexity of algorithm

Describe the algorithm in psuedo-code. You should give thought to what data structures(s) make sense for e client implementation. Determine computational complexity of your algorithm.

  Devise a linear-time algorithm to count the parallel edges

Parallel edge detection: Devise a linear-time algorithm to count the parallel edges in a graph. Write the algorithm in pseudo-code.

  Multiple choice - high school excel 2003

Cell E23 has a date value and you want to place that date on an invoice prefaced with the text located in B15. Determine the command to do that?

  Design a flowchart or pseudocode

Design a flowchart or pseudocode for the following: A program that accepts the following data about one customer's bill: customer area code (three digits), customer phone number (seven digits), and number of text messages sent. Display all the dat..

  Creating decision tree

Premium Airlines has currently offered to settle claims for a class action suit, which was originated for alleged price fixing of tickets. The settlement is stated as follows. Create a decision tree for this condition.

  Use sequential search algortithm to locate the number

These numbers should be stored in an array. Use the sequential search algortithm to locate the number entered by the user. If the number is in the array, the program should display a message.

  Design adatabase to keep track of all students at university

Discuss how you would design a database to keep track of all students at a university. Explain tables, Primary Keys, Foreign Keys, relationships, attributes, Candidate Keys.

  What is the machine run time in second for sorting array

Write computer program to implement this algorithm and demonstrate the results and what is the machine run time in second for sorting array A

  Show the evolution of the line in the first 10 minutes

Assume you are at the airport, waiting for security check.  There is one line(which is a FIFO queue), and 5 security check gates.  Each person reaching the front of the queue is checked by the first available security gate.

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