Course Solutions Uncategorized (Solved) : C Implement Doubly Linked List Please Write Simple Tests Functions Keep Track Edge Cases E Q27656658 . . . .

(Solved) : C Implement Doubly Linked List Please Write Simple Tests Functions Keep Track Edge Cases E Q27656658 . . . .

 

(C++) Implement a doubly linked list.

Please write simple tests for allfunctions.

Keep track of your edge cases: empty, 1 item, 2+items
You need to update 3 nodes every time you insert or remove: theprevious node, the selected node, and the next node.

node.h file

#ifndef LABS_NODE_H
#define LABS_NODE_H

namespace lab0{
class node{
int data;
public:
node* next;
node* prev;
explicit node(int input_data) : data(input_data), next(nullptr),prev(nullptr){};
int get_data(){return data;};
};
}

#endif

header file

#ifndef DOUBLY_LINKED_LIST_H
#define LABS_DOUBLY_LINKED_LIST_H
#include “node.h”
#include
#include

namespace lab0{
class doubly_linked_list{
lab0::node *head;
lab0::node *tail;
public:
doubly_linked_list();
doubly_linked_list(int input);
doubly_linked_list(std::vector vector_input);
doubly_linked_list(const doubly_linked_list &original);
~doubly_linked_list();
int get_data(unsigned position);
std:vector get_set(unsigned position_from, unsignedposition_to);
unsigned size();
bool is_empty();
void append(int input);
void insert(int input, unsigned location = 0);
void remove(unsigned location);
doubly_linked_list split(unsigned position);
doubly_linked_list split_set(unsigned position_1, unsignedposition_2);
void swap(unsigned position_1, unsigned position_2);
void swap_set(unsigned location_1_start, unsigned location_1_end,unsigned location_2_start, unsigned location_2_end);
void

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

(Solved) : Dlljava Generic Doubly Linked List Class Public Class Dll Private Dllnode Head Tail Public Q26729746 . . . .(Solved) : Dlljava Generic Doubly Linked List Class Public Class Dll Private Dllnode Head Tail Public Q26729746 . . . .

<p><br/>//**************************** DLL.java*******************************<br/>// generic doubly linked list class<br/>public class DLL<T> {<br/>private DLLNode<T> head, tail;<br/>public DLL() {<br/>head = tail = null;<br/>}<br/>public boolean isEmpty() {<br/>return head == null;<br/>}<br/>public void clear() {<br/>head = tail