Advertisement
ChaeYuriya

Week 6 : DLL.h

Nov 3rd, 2024
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.94 KB | None | 0 0
  1. #include <iostream>
  2. #define first(L) L.first
  3. #define last(L) L.last
  4. #define next(P) P->next
  5. #define prev(P) P->prev
  6. #define info(P) P->info
  7.  
  8. using namespace std;
  9.  
  10. struct history {
  11.     string title;
  12.     string url;
  13.     string timestamp;
  14.     int visitcount;
  15. };
  16.  
  17. typedef history infotype;
  18. struct ElmtMsk;
  19. typedef ElmtMsk* address;
  20.  
  21. struct ElmtMsk {
  22.     infotype info;
  23.     address next;
  24.     address prev;
  25. };
  26.  
  27. struct List {
  28.     address first;
  29.     address last;
  30. };
  31.  
  32. void createList(List &L);
  33. address createElemen(infotype dataBaru);
  34. void insertLast(List &L,address P);
  35. void insertAfter(List &L,address &Prec,address &P);
  36. void deleteFirst(List &L, address &P);
  37. void deleteLast(List &L,address &P);
  38. void deleteAfter(List &L,address &Prec,address &P);
  39. void printList(List L);
  40.  
  41. void insertFirst(List &L,address P);
  42. void insertAscending(List &L,infotype dataBaru);
  43. bool findElemen(List L,string X);
  44. int moreThanOnce(List L);
  45.  
  46.  
  47.  
  48.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement