The provided code reads two sequences of numbers

Assignment Help Data Structure & Algorithms
Reference no: EM13168404

 The provided code reads two sequences of numbers. In this task, you are asked to write a function to insert these numbers into two separate doubly linked lists so that the data are in ascending order. The function should have the following form. Note in the current implementation, the numbers are not inserted in ascending order.

template <typename T>

void insertOrder(dnode<T> *header, const T& item)

{

insert(header, item);

}

 

 

2. Follow the instructions under question number 36 on page 500 of the textbook and implement the following function:

template <typename T>

 

void merge(dnode<T> *list1, dnode<T> *list2)

{

}
-------------------
//d_dnode.h

#ifndef DOUBLY_LINKED_NODE_CLASS

#define DOUBLY_LINKED_NODE_CLASS

 

template <typename T>

class dnode

{

public:

// the members of a dnode object are used for operations within a

// doubly linked list; access is simplified by making them public

 

      T nodeValue; // data value of the node

dnode<T> *prev; // previous node in the list

      dnode<T> *next; // next node in the list

 

// default constructor. creates object with value T(), the

// default value of type T. set the node pointers to point at

// the node itself

      dnode()

{

next = this; // the next node is the current node

prev = this; // the previous node is the current node

}

 

      // constructor with an argument to initialize nodeValue.

// set the node pointers to point at the node itself

      dnode(const T& value): nodeValue(value)

{

next = this; // the next node is the current node

prev = this; // the previous node is the current node

}

};

 

#endif // DOUBLY_LINKED_NODE_CLASS

 

 

Reference no: EM13168404

Questions Cloud

Our string class always deletes the old character : Our String class always deletes the old character buffer and reallocates a new character buffer on assignment or in the copy constructor. This need not be done if the new value is smaller than the current value
Ext4 file systems on linux vs. ntfs file systems : List what characters are absolutely not allowed for ext4 file systems on Linux vs. NTFS file systems on Windows in a plain text document.
During the middle ages : During the Middle Ages, to determine the successor to the throne of France, the French used the Salic law. It is formulated as follows: the next to the throne is the living male descendant of the most direct male royal. Male royal here means that ..
The greatest common divisor of the fibonacci number : what is the greatest common divisor of the fibonacci numbers f100 and f101 by Euclid algorithm
The provided code reads two sequences of numbers : The provided code reads two sequences of numbers. In this task, you are asked to write a function to insert these numbers into two separate doubly linked lists so that the data are in ascending order
The packing list describes the ideal contents : The packing list describes the ideal contents of each package, but it is not always possible to include the ideal number of each item. Therefore, the actual items included in each package should be tracked. A package can contain many different ite..
Variable of type string that has been assigned : Assume that word is a variable of type string that has been assigned a value. Write an expression whose value is a string consisting of the last three characters of the value word. So if if the value if word were "biggest" the expression's value w..
Need the build function.use recursion : Implement remaining function. Everything else is provided. Use given material to receive points. Implement remaining function. Everything else is provided. Use given material to receive points. Implement remaining function. Everything else is provide..
Output the starting position and length : X Strings: Input a string. Output the starting position and length of the first occurrence of the longest substring of capital Xs in that string. The first letter is in position 1.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

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