-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlinkedList.h
More file actions
43 lines (39 loc) · 776 Bytes
/
linkedList.h
File metadata and controls
43 lines (39 loc) · 776 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef LINKED_LIST_H
#define LINKED_LIST_H
#include <iostream>
#include <vector>
#include "Node.h"
class LinkedList {
private:
Node* head;
int size;
public:
LinkedList();
int getSize();
bool isEmpty();
int value_at(int);
void push_front(int);
int pop_front();
void push_back(int);
int pop_back();
int getFront();
int getBack();
void insert(int, int);
void erase(int);
void display();
void remove_value(int);
bool isCycle();
void makeCycle();
int findMiddle();
int findMiddleHare();
void reverse();
Node* returnHead();
void mergeList(LinkedList &l1, LinkedList &l2);
void removeTheNthNodeFromEnd(int n);
void removeDuplicates();
bool isEqual(LinkedList& list2);
bool isPalindrome();
int getMaxNum();
~LinkedList();
};
#endif // !LINKED_LIST_H