If a graph with $v$ vertices is represented in the form of adjacency matrix .
Then, adding a new vertex to the existing graph requires how much time ?
Is it $O(v^2)$ or $O(2v)$ .
We have the adjacency matrix of the graph with $v$ vertices , by adding a new vertex we have to enter a row (for edges leaving the new vertex) and a column(for incident edges of new vertex) and an entry for self loop . So ,there is a need to update $2v+1$ new entries. So i am in favor of $O(2v)$. Did i miss something ? Is there any need for creating new empty matrix of size $(v+1)^2$ and then copying $v^2$ existing elements and updating remaining $2v+1$ entries of new vertex , which takes $O(v^2)$ time.
Thanks in advance .