If all of your nodes are indexed (for example, using automatic indexing), you can use the index query as a starting point, and then find those nodes that do not have outgoing relationships.
start n=node:node_auto_index("id:*") match n-[r?]->m where r is null return n
Currently, I prefer to use:
start n=node:node_auto_index("id:*") where not (n
source share