Programim C++ detyre, krijim dhe testing i nje double list link
Tirana Center of Technology
—————————driver.cpp———————-
//driver.cpp
//written to test doubly-linked list ADT
//ItemType must have << and >> operators defined
#include <fstream>
#include <iostream>
#include <string>
#include “sortlist.h”
using namespace std;
template <class ItemType>
void PrintAscending(ostream& dataFile, SortedType<ItemType>& list, string listName);
//pre: list has been initialized
// dataFile is open for output
//post: each component in list has been written to dataFile
// dataFile is still open
template <class ItemType>
void PrintDescending(ostream& dataFile, SortedType<ItemType>& list, string listName);
//pre: list has been initialized
// dataFile is open for output
//post: each component in list has been written, in reverse order, to dataFile
// dataFile is still open
void DisplayMenu(int& choice);
//pre: listA and listB have been initialized
//post: displays a menu for list operations
template <class ItemType>
void Insert(SortedType<ItemType>& list, string listName);
//pre: list has been initialized
// item to insert is entered by the user in the function
//post: Calls the ADT InsertItem and prints a message indicating
// success or failure
template <class ItemType>
void Delete(SortedType<ItemType>& list, string listName);
//pre: list has been initialized
// item to delete is entered by the user within the function
//post: Calls the ADT delete function and prints a message
// indicating success or failure.
template <class ItemType>
void Retrieve(SortedType<ItemType> list);
//pre: none
//post: prompts user for item to retrieve from list; displays message
// indicating whether or not item was found in the list
int main()
{
SortedType<int> listA, listB, listC;
int choice;
Continue reading “Detyra (3) Double Link List (ADT)”