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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
#include<cstdio>
#include<cstdlib>
#include<string>
#include<fstream>
/*
* Node Declaration
*/
using namespace std;
struct node
{
int info;
string name;
string genre;
string language;
int release_year;
int amount;
int rating;
int runtime;
struct node *next;
struct node *prev;
static int counter;
}*start;
int id=1;
/*
Class Declaration
*/
class double_llist
{
public:
void create_list(string mname,
string mgenre,
string mlanguage,
int mrelease_year,
int mamount,
int mrating,int mruntime);
void add_begin(string mname,
string mgenre,
string mlanguage,
int mrelease_year,
int mamount,
int mrating,int mruntime);
void add_after(int value, int position,
string mname,
string mgenre,
string mlanguage,
int mrelease_year,
int mamount,
int mrating,int mruntime);
void delete_element(int value);
void search_element(node *head, int value);
void display_dlist();
void sort();
int count();
void reverse();
void savetofile();
void loadfromfile();
double_llist()
{
start = NULL;
}
};
|