Results 1 to 9 of 9
Thread: (, )
Hybrid View
-
20th November 2011 20:43 #1Registered User
Join Date: Sep:2008
Location: /
Posts: 42
(, )
. .. . - . ( , ) ? :
.. ( C), ?Code:#include <iostream> using namespace std; struct zapis { int pole; zapis *next;}; typedef zapis* po; po first=NULL,last=NULL,p,pprev; //LIFO void create(po &first){ po p;char c; cout<<"Nov element?"; cin>>c; while (c=='Y' || c=='y') { p=new zapis; cout<<"Chislo"; cin>>p->pole; p->next=first; first=p; cout<<"Nov element"; cin>>c; } } void print(po p){ while (p) { cout<<p->pole<<endl<<endl; p=p->next;} system("PAUSE"); } int iztrivane(po p){ int chislo; cout<<"Chislo za iztrivane"; cin>>chislo; while (p) { if(chislo==p->pole) { pprev->next=p->next; if(p==last) last=pprev; if(p==first) first=pprev->next; delete p; break; } pprev=p; p=p->next;} } int main(){ create(first); iztrivane(first); print(first); }
.
-
21st November 2011 00:49 #2
-
24th November 2011 09:52 #3Registered User
Join Date: Sep:2008
Location: /
Posts: 42
"=++",
.
-
24th November 2011 19:32 #4
. , :
: LILO(Last In, Last Out) .. , . stack() pop(). , .
: FIFO(First In, First Out) .. , .
: .
, , , . , -1 +1(p-1-->p-->p+1). -1 +1 . .
.We are drowning in information, but starving for knowledge and time!
-
24th November 2011 20:48 #5
": LILO(Last In, Last Out)"
- - LIFO (last in first out)
" stack() pop()"
- - push() pop()
" , -1 +1"
- ( )? p+1, , p-1 p - , null.
" ."
- pop(), .
, , , ?
, pop() , , ..
-
25th November 2011 20:40 #6Registered User
Join Date: Sep:2008
Location: /
Posts: 42
, :
( ?( )). ( , - , ) , -- , .Code:P->next = Head; Head = P;




Reply With Quote
Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in