Here is the naive approach implementation:
function naiveLCA(n, parent, u, v):
marked = set
// Climb from u to root, marking all ancestors
current = u
while current != -1:
marked.add(current)
current = parent[current]
// Climb from v until we hit a marked node
current = v
while current != -1:
if current in marked:
return current
current = parent[current]
return -1
Time: where is tree height. Space: for the set of marked ancestors.