Check if given vertices form a connected subtree in a graph
You can do this in linear time.  You can tell if they're connected by keeping only those vertices and edges between them, and testing if the resulting graph is connected using standard algorithms (e.g., DFS).  You can tell if they're a tree by testing if the resulting graph has any cycles (e.g., using DFS).