Professional Documents
Culture Documents
6. a←data1.
7. end constructor.
8.end of class.
12.top←null
13.front←null
14.end constructer
16.temp←new node(h)
17.if top=null
18.top←temp
19.front←temp
20.else
21.top.next←temp
22.temp.prev←top
23.top←temp
24.end if
25.end addlast
27.temp←new bode(h)
28.if(front=null)
29.top←temp
30.front←temp
31.else
32.temp.next←front
33.front.prev←temp
34.front←temp
35.end if
36.end addfirst
38.try
40.front.next.prev←null
41.front←front.next
42.fr←null
43.end try
44.catch(NullPointerException c)
45.print is empty
46.front←null
47.end catch
48.end deletefirst
49.declare method deletelast()
50.try
52.top.prev.next←nul
53.top←top.prev
54.ls←null
55.end try
57.front←null
58.print is empty
59.front←null
60.end catch
61.end deletefirst
65.else
67.end if
68.end check_front
65.else
66.print top //as stack
67.end if
68.end check_top