Changeset 707446a for src/tests/searchsort.c
- Timestamp:
- Apr 1, 2017, 7:14:11 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 06cf47f
- Parents:
- 24c18ea
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/searchsort.c
r24c18ea r707446a 10 10 // Created On : Thu Feb 4 18:17:50 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Jul 5 18:06:07 201613 // Update Count : 5612 // Last Modified On : Sat Apr 1 19:10:12 2017 13 // Update Count : 62 14 14 // 15 15 … … 35 35 sout | *v | ", "; 36 36 } // for 37 sout | endl; 38 for ( unsigned int i = 0; i < size; i += 1 ) { 39 unsigned int posn = bsearch( size - i, iarr, size ); 40 sout | iarr[posn] | ", "; 41 } // for 37 42 sout | endl | endl; 38 43 … … 54 59 sout | *v | ", "; 55 60 } // for 61 sout | endl; 62 for ( unsigned int i = 0; i < size; i += 1 ) { 63 unsigned int posn = bsearch( size - i, iarr, size ); 64 sout | iarr[posn] | ", "; 65 } // for 56 66 } 57 67 sout | endl | endl; … … 71 81 double *v = bsearch( size - i + 0.5, darr, size ); 72 82 sout | *v | ", "; 83 } // for 84 sout | endl; 85 for ( unsigned int i = 0; i < size; i += 1 ) { 86 unsigned int posn = bsearch( size - i + 0.5, darr, size ); 87 sout | darr[posn] | ", "; 73 88 } // for 74 89 sout | endl | endl; … … 93 108 sout | *v | ", "; 94 109 } // for 110 sout | endl; 111 for ( unsigned int i = 0; i < size; i += 1 ) { 112 S temp = { size - i, size - i + 1 }; 113 unsigned int posn = bsearch( temp, sarr, size ); 114 sout | sarr[posn] | ", "; 115 } // for 95 116 sout | endl | endl; 96 117 } // main
Note: See TracChangeset
for help on using the changeset viewer.