"Yes but this method is bad, because you are duplicating the number of nodes each mesh" ?
any good pre-processor will understand that there is an adjacent element with a similar mid-side node and it should apply the same node to both elements.
else you can "equivalence" the nodes (co-incident nodes check) and get the two nodes merged, and then if you Really want you can condense the node numbering (so you don't have gaps).
"I just need a mesh generator for 2D quadratic triangle mesh, like a open source." ... ahhh ! you're trying to "kluge" together your own pre-processor ... yeah, sorry, can't help you with that. but if you have a triangle mesher, then the mid-sides are easily calculated, and the co-incident nodes easily determined (I mean, each side will be on one or two elements).
another day in paradise, or is paradise one day closer ?