I see. I think it's not the best problem area to try generic functions. You are trying to declare a family of related functions implemented some generic data structure. But it's exactly a class notion. Now your efforts demonstrated a disparity of a goal and tools.
When we need generic functions? We want a generic unit of functionality - for example, generic sort array operation...
Apropos, don't use by value parameters in program cases as in following code:
... append(node<type>** l,type elem) {
... Q->data=elem;
No need in argument copying, use references:
... append(node<type>** l,const type& elem) {
Yet another remark(s): print_l function requires operator << for template argument class. Why? There are lots of data classes without such operator but now you can't use them with your functions package. Avoid such names as print_l: simply look at print_l and print_1 (different

) names...