Skip to content
Snippets Groups Projects
Commit 4843d1b7 authored by Jonas Riedel's avatar Jonas Riedel
Browse files

Upload New File

parent 91da41e0
Branches
No related tags found
No related merge requests found
program QueueProgram
implicit none
integer, dimension(10) ::myList
myList = (/4,2,8,5,1,9,7,6,3,0/)
write(*,*)myList
call bubbleSort(myList)
write(*,*)myList
contains
subroutine swap(a,b)
integer, intent(inout) :: a,b
integer :: sw
sw = a
a = b
b = sw
end subroutine swap
subroutine bubbleSort(list)
integer, dimension(:), intent(inout) :: list
integer :: i, n
do n=size(list), 1, -1
do i=1, n-1
if(list(i) > list(i+1)) then
call swap(list(i), list(i+1))
end if
end do
end do
end subroutine bubbleSort
subroutine selectionSort(list)
end subroutine selectionSort
end program QueueProgram
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment