Algeria's President Abdelaziz Bouteflika is resigning following weeks of mass protests and after the powerful Algerian army called on him to do so.