Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- struct LIFO
- {
- LIFO * next ;
- int value;
- };
- struct FIFO
- {
- FIFO * next;
- int value;
- };
- int main()
- {
- LIFO *first;
- int k;
- LIFO *ptr = first ;
- LIFO *head = NULL;
- FIFO *top = NULL; // TOP LIST HEAD przy stacku
- while(ptr!=NULL)
- {
- if(ptr->value>k)
- {
- top -> next = ptr;
- top = ptr;
- top->next = NULL;
- }
- else
- {
- head -> next= ptr;
- head = ptr;
- head -> next = NULL;
- }
- ptr = ptr->next;
- }
- LIFO *minimum = head;
- LIFO *iteruj = head;
- while(it!=NULL)
- {
- if (minimum -> value < iteruj ->value)
- {
- minimum = iteruj;
- }
- iteruj = iteruj->next;
- }
- FIFO * maximum = top;
- FIFO * licz = top ->next;
- while (licz !=NULL)
- {
- if(maximum ->value < licz ->value)
- {
- maximum = licz ;
- }
- licz = licz ->next;
- }
- return (head,miniumum , top,maximum);
- }
- /*
- ASERCJA
- ADR x Z -> ADR x ADR x ADR x ADR ( można to zapisać jako ADR^4 czy to byłby błąd ?)
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement