Well, as far as I know, the only way to root a smartphone/tablet without PC is to install some auto-rooting apps, such as this one: viewtopic.php?f=15&t=3471&p=16930
I know they mostly worked with older versions of Android, but long time passed, so I think they managed to provide auto-root for 5.0 and higher versions.