DatenstrukturenUndAlgorithmen_Vo_20071025 - Put(Q,x if...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Put (Q,x) if anzahl=n then 'overflow' else anzahl=anzahl+1 if ende < n then ende = ende+1 else ende=1 Q[ende]=x get (Q) if anzahl=0 then 'underflow' else anzahl = anzahl -1 x=Q[anfang] if anfang < n then anfang = anfgan =1 else anfgang =1 retrun x stapel_leer(s) if t=0 return true else return false push(S,x) if t=n then 'overflow' else t=t+1 S[t] = x pop(s) if stapel_leer then 'underflow' else x=S[t] t=t+1 return x Mergesort (A,i,j) if (i<j) then k = [(i+j)/2] Mergesort(A,i,k) Mergesort(A,k+1,j) Verschmelze(A,i,k,j) Verschmelze (A,i,k,j) for l-i to k do b[1]=A[1] for r=k+1 to j do C[r]=A[r] b[k+1]=unendlich c[j+1]=unendlich l=i r=K+1 for m=i to j if(B[l] < c[3] then A[m]=B[l], l=l+1 else A[m]=C[r], r= r+1 ...
View Full Document

This note was uploaded on 11/19/2009 for the course HKJLHKJL 565 taught by Professor Fhfh during the Spring '09 term at University of Graz.

Ask a homework question - tutors are online