File tree Expand file tree Collapse file tree 3 files changed +57
-1
lines changed Expand file tree Collapse file tree 3 files changed +57
-1
lines changed Original file line number Diff line number Diff line change 1+ *&---------------------------------------------------------------------*
2+ *& Report Z_LC_BUBBLE_SORT
3+ *&---------------------------------------------------------------------*
4+ *&
5+ *&---------------------------------------------------------------------*
6+ REPORT z_lc_bubble_sort.
7+
8+
9+ TYPES : tt_input TYPE STANDARD TABLE OF i WITH EMPTY KEY .
10+
11+ DATA : lt_input TYPE tt_input.
12+
13+ lt_input = VALUE #( ( 2 ) ( 6 ) ( 4 ) ( 1 ) ( 7 ) ) .
14+
15+
16+ DATA (lines ) = lines ( lt_input ).
17+
18+
19+ DO lines TIMES .
20+ DO lines - 1 TIMES .
21+
22+ IF lt_input[ sy -index ] > lt_input[ sy -index + 1 ] .
23+
24+ DATA (temp ) = lt_input[ sy -index ].
25+ lt_input[ sy -index ] = lt_input[ sy -index + 1 ].
26+ lt_input[ sy -index + 1 ] = temp.
27+
28+ ENDIF .
29+
30+ ENDDO .
31+ ENDDO .
32+
33+
34+ LOOP AT lt_input ASSIGNING FIELD-SYMBOL (<lfs_input> ).
35+ WRITE : / <lfs_input> .
36+ ENDLOOP .
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" utf-8" ?>
2+ <abapGit version =" v1.0.0" serializer =" LCL_OBJECT_PROG" serializer_version =" v1.0.0" >
3+ <asx : abap xmlns : asx =" http://www.sap.com/abapxml" version =" 1.0" >
4+ <asx : values >
5+ <PROGDIR >
6+ <NAME >Z_LC_BUBBLE_SORT</NAME >
7+ <SUBC >1</SUBC >
8+ <RLOAD >E</RLOAD >
9+ <FIXPT >X</FIXPT >
10+ <UCCHECK >X</UCCHECK >
11+ </PROGDIR >
12+ <TPOOL >
13+ <item >
14+ <ID >R</ID >
15+ <ENTRY >Program Z_LC_BUBBLE_SORT</ENTRY >
16+ <LENGTH >24</LENGTH >
17+ </item >
18+ </TPOOL >
19+ </asx : values >
20+ </asx : abap >
21+ </abapGit >
Original file line number Diff line number Diff line change @@ -48,7 +48,6 @@ FORM mergesort TABLES lt_array TYPE STANDARD TABLE .
4848 CHECK len_array > 1 .
4949
5050 DATA (mid_array ) = len_array DIV 2 .
51- * mid_array = mid_array + 1.
5251
5352 IF lt_array[] IS NOT INITIAL .
5453
You can’t perform that action at this time.
0 commit comments