When I took calculus my teacher gave us a definition for a set $A$ to be dense in a set $B$:
Let $A,B \subset \mathbb R$. Then $A$ is dense in $B$ iff $\forall x\in B$ and $r>0$ $V^\circ_r(x)\cap A \neq \varnothing$ where $V^\circ_r(x)$ denotes the ball of radius $r$ around $x$ with the point $x$ removed, i.e., if $y\in V^\circ_r(x)$ then $0<|x-y|<r$.
So with this definition $\mathbb Q$ is dense in $\mathbb R$; $\mathbb Q$ is dense in $\mathbb Q$; but $\mathbb N$ is not dense in $\mathbb N$
I tried to generalize this definition in a topological space.
However in Brian M. Scott's answer here, there is another definition of a set being dense in another set, which applies to general topological spaces:
$A$ is dense in $B$ iff $B\subset \overline{A}$.
With this defintion $\mathbb N$ is dense in $\mathbb N$
So what is the correct definition? If it is the first one then what would be its generalization to a topological space?