Algorithms

Overview
The standard library template based algorithms to process containers using iterators for a variety of purposes (e.g. searching, sorting, counting, manipulating) that operate on ranges of elements.

Details
Asymptotic Notation is used to describe the represent time complexity of an algorithm where it represents time taken to execute the algorithm for a given input, n. 
There are three different notations: 
  1. Big O is used for the worst case running time.
  2. Big Theta (Θ) is used when the running time is the same for all cases.
  3. Big Omega (Ω) is used for the best case running time.
Out of the three, Big O notation is widely used. Besides Big O notation is also used to represent space complexity where it represents memory consumption.

Binary search algorithms  operate on various types of containers such as sequence, associative and unordered that are sorted to perform actions such as finding upper, lower, equal bounds for a value or its existence.

The following are list of APIs
lower_boundupper_boundequal_rangebinary_search

Heap Algorithms  operate on various types of containers such as sequence, associative and unordered to organize the elements of a range that allows for fast retrieval of the element with the highest 
value at any moment (with pop_heap), even repeatedly, while allowing for fast insertion of new elements  (with push_heap).  

The following are list of APIs
is_heappop_heapis_heap_untilpush_heapis_heap_untilpush_heap

Lexicographical algorithms  operate on various types of containers such as sequence, associative and unordered to perform lexicographical actions such as comparing elements, generate sequences etc.  

The following are list of APIs
lexicographical_comparenext_permutationprev_permutation

Merge algorithms  operate on various types of containers such as sequence, associative and unordered to perform actions such as merging sorted sequences, set union, intersection and differences.  

The following are list of APIs
mergeinplace_mergeincludesset_unionset_intersectionset_differenceset_symmetric_difference

Min/Max Algorithms  are template based functions that operate on various types of containers such as sequence, associative and unordered to perform actions such as finding the smallest and the largest element.  

The following are list of APIs
minmaxminmaxmin_elementmax_element

Modifying Algorithms  operate transparently on containers such as lists, vectors, maps, sets, arrays etc.  using a pair of iterators, These are collectively known as sequences. They perform actions such as  replace, remove, copy etc.  

The following are list of APIs
copycopy_ncopy_ifcopy_backwardmovemove_backwardswap
swap_rangesiter_swaptransformreplacereplace_ifreplace_copyfill
fill_ngenerategenerate_nremoveremove_ifremove_copyremove_copy_if
uniqueunique_copyreversereverse_copyrotaterotate_copyrandom_shuffle
shuffle






Non Modifying Algorithms  operate transparently on containers such as lists, vectors, maps, sets, arrays etc.  using a pair of iterators, These are collectively known as sequences. They perform actions such as search, find, count etc.  

The following are list of APIs
all_ofany_ofnone_offor_eachfindfind_iffind_end
find_first_ofadjacent_findcountcount_ifmismatchequalis_permutation
equalsearchsearch_n    

Numerical algorithms  operate on various types of containers such as sequence, associative and unordered to perform operations on the elements of a range to return a value or a sequence.  

The following are list of APIs
accumulatepartial_suminner_productiotaadjacent_difference

Partitions are commonly used for searching and sorting. Partitioning algorithms  operate on various types of containers such as sequence, associative and unordered to perform actions such as partition, sort and more.  

The following are list of APIs
partitionstable_partitionpartition_copypartition_pointis_partitionedis_partitioned
 
Sorting Algorithms  operate on various types of containers such as sequence, associative and unordered to perform actions such as sorting.  

The following are list of APIs
sortstable_sortpartial_sortpartial_sort_copyis_sortedis_sorted_untilnth_element

These algorithms can be used to in place construct objects in uninitialized memory and copy ranges or fill.

The following are list of APIs
uninitialized_copyuninitialized_copy_nuninitialized_filluninitialized_fill_n



No comments:

Post a Comment