[Solved] CS_1C Homework 14-doubly linked list

$25

File Name: CS_1C_Homework_14-doubly_linked_list.zip
File Size: 339.12 KB

SKU: [Solved] CS_1C Homework 14-doubly linked list Category: Tag:
5/5 - (1 vote)
  1. Create a doubly linked list with at least five nodes using a class template with template methods
    1. Print the linked list
  2. Add a copy constructor and overloaded assignment operator to the linked list
    1. Test the copy constructor and the copy assignment

operator

  1. Read the linked list from part 1 and create another linked list reversing the logical order of the first linked list
    1. Print the linked list
  2. Delete the third node of each list. (Also try to (1) delete a non-existent node and (2) delete from an empty list)
    1. Print both linked lists
  3. Add a node in the middle of each linked list
    1. Print both linked lists
  4. Repeat steps 1-4 using doubles
  5. Run valgrind to test for memory leaks Sample printout (similar output for doubles):

Part 1:

Linked list 1: 88 78 62 143 60

Part 2:

Linked list 1 copy constructor: 88 78 62 143 60 Linked list 1 copy assignment: 88 78 62 143 60

Part 3:

Linked list 2: 60 143 62 78 88

Part 4 (after deleting the third node):

Linked list 1: 88 78 143 60

Linked list 2: 60 143 78 88

Part 5 (after adding a node in the middle of the list):

Linked list 1: 88 78 70 143 60

Linked list 2: 60 143 70 78 88

Part 6 Repeat Part 1 thru 5 using doubles

Part 7 Run valgrind memory leak check

Extra Credit [+10 pts]

Implement an ordered singly (or doubly) linked list class (suggested name listOrdered). This time linked nodes are stored internally in ascending order. Perform operations 1 thru 5 as outlined above using listOrdered.

Run valgrind to test for memory leaks.

Use the command script to capture your interaction compiling and running the program, including all operations, as shown below:

CS1C Fall 2018 TTH HW14 100pts Due: Tu 11/27/2018

[email protected] ~/cs1c/hw/14 $ script hw14.scr Script started, file is hw14.scr [email protected] ~/cs1c/hw/14 $ date

[email protected] ~/cs1c/hw/14 $ ls -l

[email protected] ~/cs1c/hw/14 $ make all

[email protected] ~/cs1c/hw/14 $ ls -l

[email protected] ~/cs1c/hw/14 $ ./hw14

// print queue output after each addition, deletion operation above

// print output from linked list steps 1 thru 5 above // print output from valgrind memory leak check

[email protected] ~/cs1c/hw/14 $ exit

Script done, file is hw14.scr

[email protected] ~/cs1c/hw/14 $ make tar

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] CS_1C Homework 14-doubly linked list
$25