Passengers arriving via for tourist a cruise ship and who will be part of an organized shore excursion do not require a visa in advance. All other travelers must obtain a visa from an Algerian embassy or consulate in advance of travel. If you have Israeli entry stamps in your passport, you may experience difficulties.
When your passport is stamped upon entry, check how long you can stay. You may be able to request an extension of stay from the Ministry of Interior (Office of Foreigners). However, if you overstay, you may need to appear before a judge prior to departing Algeria. If you are in this situation, see your local police station.