2 |
3 |
4 | if (std::is_heap(begin(%\m sur_text%), end(%\m sur_text%))) {
5 | %\c
6 | }
7 |
8 |
9 |
10 |
11 | auto minmax = std::minmax_element(begin(%\m sur_text%), end(%\m sur_text%));
12 |
13 |
14 |
15 |
16 | auto pos = std::is_heap_until(begin(%\m sur_text%), end(%\m sur_text%));
17 | if (pos != end(%\m sur_text%)) {
18 | %\c
19 | }
20 |
21 |
22 |
23 |
24 | auto sum = std::accumulate( begin(%\m sur_text%), end(%\m sur_text%), 0, [](int total, %\c) {
25 | %\c
26 | } );
27 |
28 |
29 |
30 |
31 | if (std::equal(begin(%\m sur_text%), end(%\m sur_text%), begin(%\c))) {
32 | %\c
33 | }
34 |
35 |
36 |
37 |
38 | auto sum = std::accumulate(begin(%\m sur_text%), end(%\m sur_text%), 0);
39 |
40 |
41 |
42 |
43 | std::unique_copy(begin(%\m sur_text%), end(%\m sur_text%),
44 | std::ostream_iterator<string>(std::cout, "\n"));
45 |
46 |
47 |
48 |
49 | std::iota(begin(%\m sur_text%), end(%\m sur_text%), %\c);
50 |
51 |
52 |
53 |
54 | if (std::is_sorted(begin(%\m sur_text%), end(%\m sur_text%))) {
55 | %\c
56 | }
57 |
58 |
59 |
60 |
61 | std::replace_copy(begin(%\m sur_text%), end(%\m sur_text%), begin(%\m sur_text%), %\c, %\c);
62 |
63 |
64 |
65 |
66 | auto pos = std::is_sorted_until(begin(%\m sur_text%), end(%\m sur_text%));
67 | if (pos != end(%\m sur_text%)) {
68 | %\c
69 | }
70 |
71 |
72 |
73 |
74 | auto pos = std::remove(begin(%\m sur_text%), end(%\m sur_text%), %\c);
75 | if (pos != end(%\m sur_text%)) {
76 | %\c
77 | }
78 |
79 |
80 |
81 |
82 | std::nth_element(begin(%\m sur_text%), end(%\m sur_text%), end(%\m sur_text%));
83 |
84 |
85 |
86 |
87 | std::replace_if(begin(%\m sur_text%), end(%\m sur_text%), [](%\c) {
88 | %\c
89 | }, %\c);
90 |
91 |
92 |
93 |
94 | std::replace(begin(%\m sur_text%), end(%\m sur_text%), %\c, %\c);
95 |
96 |
97 |
98 |
99 | %\m sur_text%.erase( std::remove( begin(%\m sur_text%), end(%\m sur_text%), %\c ), end(%\m sur_text%) );
100 |
101 |
102 |
103 |
104 | std::transform(begin(%\m sur_text%), end(%\m sur_text%),
105 | begin(%\m sur_text%), [](%\c) {
106 | %\c%
107 | } );
108 |
109 |
110 |
111 |
112 | std::fill_n(begin(%\m sur_text%), %\c, %\c );
113 |
114 |
115 |
116 |
117 | if (std::all_of(begin(%\m sur_text%), end(%\m sur_text%), [](%\c) {
118 | %\c
119 | } ) ) {
120 | %\c
121 | }
122 |
123 |
124 |
125 |
126 | if (std::prev_permutation(begin(%\m sur_text%), end(%\m sur_text%))) {
127 | %\c
128 | }
129 |
130 |
131 |
132 |
133 | %\m sur_text%.erase(0, %\m sur_text%.find_first_not_of(" \t\n\r"));
134 |
135 |
136 |
137 |
138 | std::transform(begin(%\m sur_text%), end(%\m sur_text%), begin(%\m sur_text%), [](char c) {
139 | return std::toupper(c);
140 | } );
141 | %\c
142 |
143 |
144 |
145 |
146 | std::partial_sort_copy(begin(%\m sur_text%), end(%\m sur_text%),
147 | begin(%\c), end(%\c));
148 |
149 |
150 |
151 |
152 | auto pos = std::partition_point(begin(%\m sur_text%), end(%\m sur_text%), [](%\c) {
153 | %\c
154 | } );
155 | if (pos != end(%\m sur_text%)) {
156 | %\c
157 | }
158 |
159 |
160 |
161 |
162 | auto n = std::count(begin(%\m sur_text%), end(%\m sur_text%), %\c);
163 |
164 |
165 |
166 |
167 | auto pos = std::unique(begin(%\m sur_text%), end(%\m sur_text%));
168 |
169 |
170 |
171 |
172 | std::copy(begin(%\m sur_text%), end(%\m sur_text%), begin(%\c));
173 |
174 |
175 |
176 |
177 | std::copy_backward(begin(%\m sur_text%), end(%\m sur_text%), end(%\m sur_text%));
178 |
179 |
180 |
181 |
182 | swap_ranges(begin(%\m sur_text%), end(%\m sur_text%), begin(%\c));
183 |
184 |
185 |
186 |
187 | std::rotate_copy(begin(%\m sur_text%), begin(%\c), end(%\m sur_text%),
188 | begin(%\c));
189 |
190 |
191 |
192 |
193 | auto pos = std::max_element(begin(%\m sur_text%), end(%\m sur_text%));
194 |
195 |
196 |
197 |
198 | std::rotate(begin(%\m sur_text%), begin(%\c), end(%\m sur_text%));
199 |
200 |
201 |
202 |
203 | std::copy_if(begin(%\m sur_text%), end(%\m sur_text%), begin(%\c),
204 | [](%\c) {
205 | %\c
206 | } );
207 |
208 |
209 |
210 |
211 | auto n = std::count_if(begin(%\m sur_text%), end(%\m sur_text%), [](%\c) {
212 | %\c
213 | });
214 |
215 |
216 |
217 |
218 | std::copy_n(begin(%\m sur_text%), %\c, end(%\m sur_text%));
219 |
220 |
221 |
222 |
223 | std::sort(begin(%\m sur_text%), end(%\m sur_text%));
224 |
225 |
226 |
227 |
228 | auto pos = std::stable_partition(begin(%\m sur_text%), end(%\m sur_text%), [](%\c) {
229 | %\c});
230 | if (pos != end(%\m sur_text%)) {
231 | %\c
232 | }
233 |
234 |
235 |
236 |
237 | auto values = std::mismatch(begin(%\m sur_text%), end(%\m sur_text%), begin(%\m sur_text%));
238 | if (values.first == end(%\m sur_text%)) {
239 | %\c
240 | } else {
241 | %\c
242 | }
243 |
244 |
245 |
246 |
247 | std::move_backward(begin(%\m sur_text%), end(%\m sur_text%), end(%\m sur_text%));
248 |
249 |
250 |
251 |
252 | std::partition_copy(begin(%\m sur_text%), end(%\m sur_text%),
253 | begin(%\c), end(%\c));
254 |
255 |
256 |
257 |
258 | std::partial_sort(begin(%\m sur_text%), end(%\m sur_text%), end(%\m sur_text%));
259 |
260 |
261 |
262 |
263 | auto pos = std::find(begin(%\m sur_text%), end(%\m sur_text%), %\c);
264 | if (pos != end(%\m sur_text%)) {
265 | %\c
266 | }
267 |
268 |
269 |
270 |
271 | std::for_each( begin(%\m sur_text%), end(%\m sur_text%), [](%\c) {
272 | %\c
273 | } );
274 |
275 |
276 |
277 |
278 | auto pos = std::min_element(begin(%\m sur_text%), end(%\m sur_text%));
279 |
280 |
281 |
282 |
283 | auto pos = std::find_end(begin(%\m sur_text%), end(%\m sur_text%),
284 | begin(%\c), end(%\c));
285 | if (pos != end(%\m sur_text%)) {
286 | %\c
287 | }
288 |
289 |
290 |
291 |
292 | std::merge(begin(%\m sur_text%), end(%\m sur_text%),
293 | begin(%\c), end(%\c), begin(%\c));
294 |
295 |
296 |
297 |
298 | auto pos = std::search(begin(%\m sur_text%), end(%\m sur_text%),
299 | egin(%\c), end(%\c));
300 | if (pos != end(%\m sur_text%)) {
301 | %\c
302 | }
303 |
304 |
305 |
306 |
307 | auto pos = std::find_if(begin(%\m sur_text%), end(%\m sur_text%), []( %\c ) {
308 | %\c
309 | });
310 | if (pos != end(%\m sur_text%)) {
311 | %\c
312 | }
313 |
314 |
315 |
316 |
317 | auto pos = std::partition(begin(%\m sur_text%), end(%\m sur_text%), [](%\c) {
318 | %\c
319 | });
320 | if (pos != end(%\m sur_text%)) {
321 | %\c
322 | }
323 |
324 |
325 |
326 |
327 | auto pos = std::search_n(begin(%\m sur_text%), end(%\m sur_text%),%\c,%\c);
328 | if (pos != end(%\m sur_text%)) {
329 | %\c
330 | }
331 |
332 |
333 |
334 |
335 | if (std::any_of(begin(%\m sur_text%), end(%\m sur_text%), [](%\c) {
336 | %\c
337 | } ) ) {
338 | %\c
339 | }
340 |
341 |
342 |
343 |
344 | if (std::next_permutation(begin(%\m sur_text%), end(%\m sur_text%))) {
345 | %\c
346 | }
347 |
348 |
349 |
350 |
351 | std::reverse(begin(%\m sur_text%), end(%\m sur_text%));
352 |
353 |
354 |
355 |
356 | std::remove_copy(begin(%\m sur_text%), end(%\m sur_text%),
357 | begin(%\m sur_text%), %\c);
358 |
359 |
360 |
361 |
362 | std::stable_sort(begin(%\m sur_text%), end(%\m sur_text%));
363 |
364 |
365 |
366 |
367 | std::remove_copy_if( begin(%\m sur_text%), end(%\m sur_text%),
368 | begin(%\m sur_text%), [](%\c) {
369 | %\c
370 | } );
371 |
372 |
373 |
374 |
375 | std::replace_copy_if(begin(%\m sur_text%), end(%\m sur_text%),
376 | begin(%\m sur_text%), [](%\c) {
377 | %\c
378 | }, %\c );
379 |
380 |
381 |
382 |
383 | auto pos = std::remove_if( begin(%\m sur_text%), end(%\m sur_text%), [](%\c) {
384 | %\c
385 | } );
386 | if (pos != end(%\m sur_text%)) {
387 | %\c
388 | }
389 |
390 |
391 |
392 |
393 | std::reverse_copy(begin(%\m sur_text%), end(%\m sur_text%), begin(%\c));
394 |
395 |
396 |
397 |
398 | std::copy( begin( %\m sur_text% ), end( %\m sur_text% ), std::ostream_iterator<%\c>{
399 | %\istd::cout, "%\c"
400 | } );
401 |
402 |
403 |
404 |
405 | std::sort_heap(begin(%\m sur_text%), end(%\m sur_text%));
406 |
407 |
408 |
409 |
410 | std::push_heap(begin(%\m sur_text%), end(%\m sur_text%));
411 |
412 |
413 |
414 |
415 | auto pos = std::find_first_of(begin(%\m sur_text%), end(%\m sur_text%),
416 | begin(%\c), end(%\c));
417 | if (pos != end(%\m sur_text%)) {
418 | %\c
419 | }
420 |
421 |
422 |
423 |
424 | std::generate(begin(%\m sur_text%), end(%\m sur_text%), [](%\c) {
425 | %\c
426 | } );
427 |
428 |
429 |
430 |
431 | if (std::is_permutation(begin(%\m sur_text%), end(%\m sur_text%), begin(%\c))) {
432 | %\c
433 | }
434 |
435 |
436 |
437 |
438 | if (std::is_partitioned(begin(%\m sur_text%), end(%\m sur_text%), [](%\c) {
439 | %\c
440 | } ) ) {
441 | %\c
442 | }
443 |
444 |
445 |
446 |
447 | std::make_heap(begin(%\m sur_text%), end(%\m sur_text%));
448 |
449 |
450 |
451 |
452 | std::fill(begin(%\m sur_text%), end(%\m sur_text%), %\c);
453 |
454 |
455 |
456 |
457 | auto pos = std::find_if_not(begin(%\m sur_text%), end(%\m sur_text%),[](%\c) {
458 | %\c
459 | } );
460 | if (pos != end(%\m sur_text%)) {
461 | %\c
462 | }
463 |
464 |
465 |
466 |
467 | std::transform(begin(%\m sur_text%), end(%\m sur_text%), begin(%\m sur_text%), [](char c) {
468 | return std::tolower(c); } );
469 |
470 |
471 |
472 |
473 | if (std::lexigraphical_compare(begin(%\m sur_text%), end(%\m sur_text%),
474 | begin(%\c), end(%\c)) {
475 | %\c
476 | }
477 |
478 |
479 |
480 |
481 | std::random_shuffle(begin(%\m sur_text%), end(%\m sur_text%));
482 |
483 |
484 |
485 |
486 | auto pos = std::adjacent_find(begin(%\m sur_text%), end(%\m sur_text%));
487 | if (pos != end(%\m sur_text%)) {
488 | %\c
489 | }
490 |
491 |
492 |
493 |
494 | %\m sur_text%.erase(%\m sur_text%.find_last_not_of(" \t\n\r") + 1);
495 |
496 |
497 |
498 |
499 | std::generate_n(begin(%\m sur_text%), %\c, [](%\c) {
500 | %\c
501 | } );
502 |
503 |
504 |
505 |
506 | if (std::none_of(begin(%\m sur_text%), end(%\m sur_text%), [](%\c) {
507 | %\c
508 | } ) ) {
509 | %\c
510 | }
511 |
512 |
513 |
514 |
515 | std::cin >> %\c
516 |
517 |
518 |
519 |
520 | std::cout << %\c
521 |
522 |
523 |
524 |
525 | std::vector<%\c> %\c
526 |
527 |
528 |
529 |
--------------------------------------------------------------------------------
/algorithm_mnemonics.xml:
--------------------------------------------------------------------------------
1 |
32 |
33 |
44 |
45 |
46 |
47 |
48 | if (std::is_heap(std::begin(%\m C%), std::end(%\m C%))) {
49 | %\c
50 | }
51 |
52 |
53 |
54 |
55 | auto minmax = std::minmax_element(std::begin(%\m C%), std::end(%\m C%));
56 |
57 |
58 |
59 |
60 | auto pos = std::is_heap_until(std::begin(%\m C%), std::end(%\m C%));
61 | if (pos != std::end(%\m C%)) {
62 | %\c
63 | }
64 |
65 |
66 |
67 |
68 | auto sum = std::accumulate(std::begin(%\m C%), std::end(%\m C%), 0, [](int total, %\c) {
69 | %\c
70 | });
71 |
72 |
73 |
74 |
75 | if (std::equal(std::begin(%\m C%), std::end(%\m C%), std::begin(%\c))) {
76 | %\c
77 | }
78 |
79 |
80 |
81 |
82 | auto sum = std::accumulate(std::begin(%\m C%), std::end(%\m C%), 0);
83 |
84 |
85 |
86 |
87 | std::unique_copy(std::begin(%\m C%), std::end(%\m C%),
88 | std::ostream_iterator<string>(std::cout, "\n"));
89 |
90 |
91 |
92 |
93 | std::iota(std::begin(%\m C%), std::end(%\m C%), %\c);
94 |
95 |
96 |
97 |
98 | if (std::is_sorted(std::begin(%\m C%), std::end(%\m C%))) {
99 | %\c
100 | }
101 |
102 |
103 |
104 |
105 | std::replace_copy(std::begin(%\m C%), std::end(%\m C%), std::begin(%\m C%), %\c, %\c);
106 |
107 |
108 |
109 |
110 | auto pos = std::is_sorted_until(std::begin(%\m C%), std::end(%\m C%));
111 | if (pos != std::end(%\m C%)) {
112 | %\c
113 | }
114 |
115 |
116 |
117 |
118 | auto pos = std::remove(std::begin(%\m C%), std::end(%\m C%), %\c);
119 | if (pos != std::end(%\m C%)) {
120 | %\c
121 | }
122 |
123 |
124 |
125 |
126 | std::nth_element(std::begin(%\m C%), std::end(%\m C%), std::end(%\m C%));
127 |
128 |
129 |
130 |
131 | std::replace_if(std::begin(%\m C%), std::end(%\m C%), [](%\c) {
132 | %\c
133 | }, %\c);
134 |
135 |
136 |
137 |
138 | std::replace(std::begin(%\m C%), std::end(%\m C%), %\c, %\c);
139 |
140 |
141 |
142 |
143 | %\m C%.erase(std::remove(std::begin(%\m C%), std::end(%\m C%), %\c), std::end(%\m C%));
144 |
145 |
146 |
147 |
148 | std::transform(std::begin(%\m C%), std::end(%\m C%),
149 | std::begin(%\m C%), [](%\c) {
150 | %\c%
151 | });
152 |
153 |
154 |
155 |
156 | std::fill_n(std::begin(%\m C%), %\c, %\c);
157 |
158 |
159 |
160 |
161 | if (std::all_of(std::begin(%\m C%), std::end(%\m C%), [](%\c) {
162 | %\c
163 | })) {
164 | %\c
165 | }
166 |
167 |
168 |
169 |
170 | if (std::prev_permutation(std::begin(%\m C%), std::end(%\m C%))) {
171 | %\c
172 | }
173 |
174 |
175 |
176 |
177 | %\m C%.erase(0, %\m C%.find_first_not_of(" \t\n\r"));
178 |
179 |
180 |
181 |
182 | std::transform(std::begin(%\m C%), std::end(%\m C%), std::begin(%\m C%), [](char c) {
183 | return std::toupper(c);
184 | });
185 | %\c
186 |
187 |
188 |
189 |
190 | std::partial_sort_copy(std::begin(%\m C%), std::end(%\m C%),
191 | std::begin(%\c), std::end(%\c));
192 |
193 |
194 |
195 |
196 | auto pos = std::partition_point(std::begin(%\m C%), std::end(%\m C%), [](%\c) {
197 | %\c
198 | });
199 | if (pos != std::end(%\m C%)) {
200 | %\c
201 | }
202 |
203 |
204 |
205 |
206 | auto n = std::count(std::begin(%\m C%), std::end(%\m C%), %\c);
207 |
208 |
209 |
210 |
211 | auto pos = std::unique(std::begin(%\m C%), std::end(%\m C%));
212 |
213 |
214 |
215 |
216 | std::cin >>
217 |
218 |
219 |
220 |
221 | std::copy(std::begin(%\m C%), std::end(%\m C%), std::begin(%\c));
222 |
223 |
224 |
225 |
226 | std::cout <<
227 |
228 |
229 |
230 |
231 | std::copy_backward(std::begin(%\m C%), std::end(%\m C%), std::end(%\m C%));
232 |
233 |
234 |
235 |
236 | std::swap_ranges(std::begin(%\m C%), std::end(%\m C%), std::begin(%\c));
237 |
238 |
239 |
240 |
241 | std::rotate_copy(std::begin(%\m C%), std::begin(%\c), std::end(%\m C%),
242 | std::begin(%\c));
243 |
244 |
245 |
246 |
247 | auto pos = std::max_element(std::begin(%\m C%), std::end(%\m C%));
248 |
249 |
250 |
251 |
252 | std::rotate(std::begin(%\m C%), std::begin(%\c), std::end(%\m C%));
253 |
254 |
255 |
256 |
257 | std::vector<%\c> %\c
258 |
259 |
260 |
261 |
262 | std::copy_if(std::begin(%\m C%), std::end(%\m C%), std::begin(%\c),
263 | [](%\c) {
264 | %\c
265 | });
266 |
267 |
268 |
269 |
270 | auto n = std::count_if(std::begin(%\m C%), std::end(%\m C%), [](%\c) {
271 | %\c
272 | });
273 |
274 |
275 |
276 |
277 | std::copy_n(std::begin(%\m C%), %\c, std::end(%\m C%));
278 |
279 |
280 |
281 |
282 | std::sort(std::begin(%\m C%), std::end(%\m C%));
283 |
284 |
285 |
286 |
287 | auto pos = std::stable_partition(std::begin(%\m C%), std::end(%\m C%), [](%\c) {
288 | %\c});
289 | if (pos != std::end(%\m C%)) {
290 | %\c
291 | }
292 |
293 |
294 |
295 |
296 | auto values = std::mismatch(std::begin(%\m C%), std::end(%\m C%), std::begin(%\m C%));
297 | if (values.first == std::end(%\m C%)) {
298 | %\c
299 | } else {
300 | %\c
301 | }
302 |
303 |
304 |
305 |
306 | std::partition_copy(std::begin(%\m C%), std::end(%\m C%),
307 | std::begin(%\c), std::end(%\c));
308 |
309 |
310 |
311 |
312 | std::partial_sort(std::begin(%\m C%), std::end(%\m C%), std::end(%\m C%));
313 |
314 |
315 |
316 |
317 | auto pos = std::find(std::begin(%\m C%), std::end(%\m C%), %\c);
318 | if (pos != std::end(%\m C%)) {
319 | %\c
320 | }
321 |
322 |
323 |
324 |
325 | std::for_each(std::begin(%\m C%), std::end(%\m C%), [](%\c) {
326 | %\c
327 | });
328 |
329 |
330 |
331 |
332 | auto pos = std::min_element(std::begin(%\m C%), std::end(%\m C%));
333 |
334 |
335 |
336 |
337 | auto pos = std::find_std::end(std::begin(%\m C%), std::end(%\m C%),
338 | std::begin(%\c), std::end(%\c));
339 | if (pos != std::end(%\m C%)) {
340 | %\c
341 | }
342 |
343 |
344 |
345 |
346 | std::merge(std::begin(%\m C%), std::end(%\m C%),
347 | std::begin(%\c), std::end(%\c), std::begin(%\c));
348 |
349 |
350 |
351 |
352 | auto pos = std::search(std::begin(%\m C%), std::end(%\m C%),
353 | std::begin(%\c), std::end(%\c));
354 | if (pos != std::end(%\m C%)) {
355 | %\c
356 | }
357 |
358 |
359 |
360 |
361 | auto pos = std::find_if(std::begin(%\m C%), std::end(%\m C%), [](%\c) {
362 | %\c
363 | });
364 | if (pos != std::end(%\m C%)) {
365 | %\c
366 | }
367 |
368 |
369 |
370 |
371 | auto pos = std::partition(std::begin(%\m C%), std::end(%\m C%), [](%\c) {
372 | %\c
373 | });
374 | if (pos != std::end(%\m C%)) {
375 | %\c
376 | }
377 |
378 |
379 |
380 |
381 | auto pos = std::search_n(std::begin(%\m C%), std::end(%\m C%),%\c,%\c);
382 | if (pos != std::end(%\m C%)) {
383 | %\c
384 | }
385 |
386 |
387 |
388 |
389 | if (std::any_of(std::begin(%\m C%), std::end(%\m C%), [](%\c) {
390 | %\c
391 | })) {
392 | %\c
393 | }
394 |
395 |
396 |
397 |
398 | if (std::next_permutation(std::begin(%\m C%), std::end(%\m C%))) {
399 | %\c
400 | }
401 |
402 |
403 |
404 |
405 | std::reverse(std::begin(%\m C%), std::end(%\m C%));
406 |
407 |
408 |
409 |
410 | std::remove_copy(std::begin(%\m C%), std::end(%\m C%),
411 | std::begin(%\m C%), %\c);
412 |
413 |
414 |
415 |
416 | std::stable_sort(std::begin(%\m C%), std::end(%\m C%));
417 |
418 |
419 |
420 |
421 | std::remove_copy_if(std::begin(%\m C%), std::end(%\m C%),
422 | std::begin(%\m C%), [](%\c) {
423 | %\c
424 | });
425 |
426 |
427 |
428 |
429 | std::replace_copy_if(std::begin(%\m C%), std::end(%\m C%),
430 | std::begin(%\m C%), [](%\c) {
431 | %\c
432 | }, %\c);
433 |
434 |
435 |
436 |
437 | auto pos = std::remove_if(std::begin(%\m C%), std::end(%\m C%), [](%\c) {
438 | %\c
439 | });
440 | if (pos != std::end(%\m C%)) {
441 | %\c
442 | }
443 |
444 |
445 |
446 |
447 | std::reverse_copy(std::begin(%\m C%), std::end(%\m C%), std::begin(%\c));
448 |
449 |
450 |
451 |
452 | std::copy(std::begin(%\m C%), std::end(%\m C%), std::ostream_iterator<%\c>{
453 | %\istd::cout, "%\c"
454 | });
455 |
456 |
457 |
458 |
459 | std::sort_heap(std::begin(%\m C%), std::end(%\m C%));
460 |
461 |
462 |
463 |
464 | std::push_heap(std::begin(%\m C%), std::end(%\m C%));
465 |
466 |
467 |
468 |
469 | auto pos = std::find_first_of(std::begin(%\m C%), std::end(%\m C%),
470 | std::begin(%\c), std::end(%\c));
471 | if (pos != std::end(%\m C%)) {
472 | %\c
473 | }
474 |
475 |
476 |
477 |
478 | std::generate(std::begin(%\m C%), std::end(%\m C%), [](%\c) {
479 | %\c
480 | });
481 |
482 |
483 |
484 |
485 | if (std::is_permutation(std::begin(%\m C%), std::end(%\m C%), std::begin(%\c))) {
486 | %\c
487 | }
488 |
489 |
490 |
491 |
492 | if (std::is_partitioned(std::begin(%\m C%), std::end(%\m C%), [](%\c) {
493 | %\c
494 | })) {
495 | %\c
496 | }
497 |
498 |
499 |
500 |
501 | std::make_heap(std::begin(%\m C%), std::end(%\m C%));
502 |
503 |
504 |
505 |
506 | std::fill(std::begin(%\m C%), std::end(%\m C%), %\c);
507 |
508 |
509 |
510 |
511 | auto pos = std::find_if_not(std::begin(%\m C%), std::end(%\m C%),[](%\c) {
512 | %\c
513 | });
514 | if (pos != std::end(%\m C%)) {
515 | %\c
516 | }
517 |
518 |
519 |
520 |
521 | std::transform(std::begin(%\m C%), std::end(%\m C%), std::begin(%\m C%), [](char c) {
522 | return std::tolower(c); });
523 |
524 |
525 |
526 |
527 | if (std::lexigraphical_compare(std::begin(%\m C%), std::end(%\m C%),
528 | std::begin(%\c), std::end(%\c)) {
529 | %\c
530 | }
531 |
532 |
533 |
534 |
535 | std::random_shuffle(std::begin(%\m C%), std::end(%\m C%));
536 |
537 |
538 |
539 |
540 | auto pos = std::adjacent_find(std::begin(%\m C%), std::end(%\m C%));
541 | if (pos != std::end(%\m C%)) {
542 | %\c
543 | }
544 |
545 |
546 |
547 |
548 | %\m C%.erase(%\m C%.find_last_not_of(" \t\n\r") + 1);
549 |
550 |
551 |
552 |
553 | std::generate_n(std::begin(%\m C%), %\c, [](%\c) {
554 | %\c
555 | });
556 |
557 |
558 |
559 |
560 | if (std::none_of(std::begin(%\m C%), std::end(%\m C%), [](%\c) {
561 | %\c
562 | })) {
563 | %\c
564 | }
565 |
566 |
567 |
568 |
569 | std::pop_heap(std::begin(%\m C%), std::end(%\m C%));
570 |
571 |
572 |
573 |
574 | auto pos = std::binary_search(std::begin(%\m C%), std::end(%\m C%), %\c);
575 | if (pos != std::end(%\m C%)) {
576 | %\c
577 | }
578 |
579 |
580 |
581 |
582 | if (std::includes(std::begin(%\m C%), std::end(%\m C%),
583 | std::begin(%\c), std::end(%\c))) {
584 | %\c
585 | }
586 |
587 |
588 |
589 |
590 | auto pos = std::lower_bound(std::begin(%\m C%), std::end(%\m C%), %\c);
591 | if (pos != std::end(%\m C%)) {
592 | %\c
593 | }
594 |
595 |
596 |
597 |
598 | auto pos = std::upper_bound(std::begin(%\m C%), std::end(%\m C%), %\c);
599 | if (pos != std::end(%\m C%)) {
600 | %\c
601 | }
602 |
603 |
604 |
605 |
606 | auto bounds = std::equal_range(std::begin(%\m C%), std::end(%\m C%), %\c);
607 |
608 |
609 |
610 |
611 | auto bounds = std::equal_range(std::begin(%\m C%), std::end(%\m C%), %\c,
612 | [](%\c,%\c) { %\c });
613 |
614 |
615 |
616 |
617 | auto pos = std::set_union(std::begin(%\m C%), std::end(%\m C%),
618 | std::begin(%\c), std::end(%\c), std::begin(%\c));
619 |
620 |
621 |
622 |
623 | auto pos = std::set_intersection(std::begin(%\m C%), std::end(%\m C%),
624 | std::begin(%\c), std::end(%\c), std::begin(%\c));
625 |
626 |
627 |
628 |
629 | auto pos = std::set_difference(std::begin(%\m C%), std::end(%\m C%),
630 | std::begin(%\c), std::end(%\c), std::begin(%\c));
631 |
632 |
633 |
634 |
635 | auto pos = std::set_symmetric_difference(std::begin(%\m C%),
636 | std::end(%\m C%), std::begin(%\c), std::end(%\c), std::begin(%\c));
637 |
638 |
639 |
640 |
641 | std::inplace_merge(std::begin(%\m C%), std::end(%\m C%), std::end(%\m C%));
642 |
643 |
644 |
645 |
646 | std::move(std::begin(%\m C%), std::end(%\m C%), std::begin(%\m C%));
647 |
648 |
649 |
650 |
651 | std::move_backward(std::begin(%\m C%), std::end(%\m C%), std::end(%\m C%));
652 |
653 |
654 |
655 |
656 | std::swap(%\m C%, %\c);
657 |
658 |
659 |
660 |
--------------------------------------------------------------------------------
/list.sh:
--------------------------------------------------------------------------------
1 | #! /bin/bash
2 | ################################################################################
3 | # Name: list.sh
4 | #
5 | # Create documentation from Algorithm Mnemonics XML document.
6 | #
7 | # Usage: list.sh [-cm]
8 | #
9 | # Where: -c Write categories
10 | # -m Write markdown format
11 | #
12 | # Author: Tommy Bennett, tommy_bennett@icloud.com
13 | # Date: 2016-10-15
14 | ################################################################################
15 |
16 | # Constants
17 | declare -r ALGORITHM_MNEMONICS="algorithm_mnemonics.xml"
18 | declare -r SCRIPT_NAME="list.sh"
19 | declare -r SCRIPT_DESCRIPTION="Algorithm Mnemonics Documentation"
20 | declare -r VERSION="version 1.0"
21 | declare -a NAME
22 | declare -a EXPANDEDNAME
23 | declare -r NONMODIFYING=0
24 | declare -r SORTING=1
25 | declare -r SORTEDRANGES=2
26 | declare -r MODIFYING=3
27 | declare -r REMOVING=4
28 | declare -r MUTATING=5
29 | declare -r NUMERIC=6
30 | declare -r IDIOMS=7
31 | declare -r STRINGS=8
32 | declare -r STREAMS=9
33 | declare -r CONTAINERS=10
34 |
35 |
36 | # Prints the usage information to standard output.
37 | #
38 | function usage() {
39 | echo "$SCRIPT_NAME ($SCRIPT_DESCRIPTION) $VERSION"
40 | echo
41 | echo "usage: $SCRIPT_NAME [-cm]"
42 | echo
43 | echo "where: -c Write categories"
44 | echo " -m Write markdown format"
45 | echo
46 | exit 1
47 | }
48 |
49 | # Prints the version information to standard output.
50 | #
51 | function version() {
52 | echo "$SCRIPT_NAME ($SCRIPT_DESCRIPTION) $VERSION"
53 | echo "Copyright (C) 2016 Tommy Bennett."
54 | echo "License GPLv3+: GNU GPL version 3 or" \
55 | "later