3 ms·
What? No! (Sequential) algorithms are usually analysed in the Random Access Machine Model (RAM model). That's a machine that can access any memory location in c
by lorenzhs 10y ago
What? No! (Sequential) algorithms are usually analysed in the Random Access Machine Model (RAM model). That's a machine that can access any memory location in constant time, and perform arithmetic operations in constant time. See https://en.wikipedia.org/wiki/Random-access_machine https://en.wikipedia.org/wiki/Random-access_machine
A Turing machine can only go left or right one cell in each step, so e.g. comparing two strings for equality takes O(n²) time as you have to go character by character, moving the head over a suffix of the first word and a prefix of the second word for every character.