Almost all algorithms are composition of algorithms. Probably a good way to define a singular algorithm is the point a human has to be the source of its input. A self driving car is a composition of thousands of algorithms by definition -- a process that step by step calculates with an input and output which is every single method in all its code. However, for sake of conversation in the number of complete autonomous systems consider the car to be a single algorithm defined by the point a human has to be the originating input at the interface where the key gets turned to turn it on.
I think this definition will be important in law because it is where we will define responsibility for actions of autonomous things.