Global Alignment:
Finding the optimal global alignment of two sequences is solved by the Needleman-Wunsch algorithm.
Semi-global Alignment (e.g. overlapping sequences):
The semi-global alignment is a specially configured global alignment, namely we do not penalize gaps at the ends of the alignment. Semi-global alignments are often used in genome assembly applications when trying to find matching overlaps.