01-30-2012
yes that is exactly what I want. I am going to try to do what you mentioned, althought I am not sure if I understood the part of the special case.
"....have to special case when you want the node to be inserted as the first position in the list. Maybe, in that case, you should pass the p variable as NULL and then check for NULL in dlist_insert and handle it correctly by linking it to the head of l...."
Could you elaborate a bit on that please? Thank you again!
10 More Discussions You Might Find Interesting
1. Programming
Can any one help me in reversing the single linked list and at the same time i want to print the reversed links. (2 Replies)
Discussion started by: dhanamurthy
2 Replies
2. UNIX for Dummies Questions & Answers
A perl script that displays the list of files which have multiple links..!
ls -l shows number of links in a field. (0 Replies)
Discussion started by: aadi_uni
0 Replies
3. Programming
Suppose to have:
struct Tstudent
{
string name, surname;
int matriculation_num;
};
struct Tnode
{
Tstudent* student;
Tnodo* next;
} L;I want to deference that "student" pointer. For example, I tried with:
*(L->student).matriculation_numbut it not worked, as terminal... (4 Replies)
Discussion started by: Luke Bonham
4 Replies
4. Programming
is this possible, if so plz please share with me..
Correct English please, not Cyber-/Leetspeak (11 Replies)
Discussion started by: vijay_manpage
11 Replies
5. Programming
I need C++ Code for single linked list
With operations as
1)insert at any position
2)delete any
3)change the data of any position (2 Replies)
Discussion started by: girija
2 Replies
6. Programming
i have this code
typedef struct client_list {
char *client_name;
struct client_list * next;
int client_socket_fd;
} client;
client *current, *head; head = NULL;
char *h="test";
add_client(current, h, head, &client_socket_fd);
... (24 Replies)
Discussion started by: omega666
24 Replies
7. Programming
i have a linked list set up like
typedef struct client_list {
char *client_name;
int client_socket_fd;
struct client_list *next;
} client;
client *client_list=NULL;
before adding to the list i check if it already exists, only if it does not then i add
if (client_list==NULL... (1 Reply)
Discussion started by: omega666
1 Replies
8. Programming
#include<stdio.h>
#include<stdlib.h>
struct LinkedList
{
int val;
struct LinkedList *next;
}node; /*Creating a structure variable*/
typedef struct LinkedList Node;
Node *start = NULL;
int create(int i)
{
Node *temp = NULL;
if (start == NULL)
... (5 Replies)
Discussion started by: prinsh
5 Replies
9. Programming
How to delete the last node in a single linked list given only the pointer to last node ?
Head node will not be given. (5 Replies)
Discussion started by: VSSajjan
5 Replies
10. Programming
Program to reverse a linked list by traversing only once. (1 Reply)
Discussion started by: VSSajjan
1 Replies
LEARN ABOUT DEBIAN
blt_treecreatenode
Blt_TreeCreateNode(3) BLT Library Procedures Blt_TreeCreateNode(3)
__________________________________________________________________________________________________________________________________________________
NAME
Blt_TreeCreateNode - Creates a node in a tree data object.
SYNOPSIS
#include <bltTree.h>
Blt_TreeNode
Blt_TreeCreateNode(tree, parent, name, position)
ARGUMENTS
Blt_Tree tree (in) Tree containing the parent node.
Blt_TreeNode parent (in) Node in which to insert the new child.
const char *name (in) Node label. If NULL, a label will automatically be generated.
int position (in) Position in the parent's list of children to insert the new node.
_________________________________________________________________
DESCRIPTION
This procedure creates a new node is a tree data object. The node is initially empty, but data values can be added with Blt_TreeSetValue.
Each node has a serial number that identifies it within the tree. No two nodes in the same tree will ever have the same ID. You can find
a node's ID with Blt_TreeNodeId.
The arguments are as follows:
tree The tree containing the parent node.
parent Node in which the new child will be inserted.
name Label of the new node. If name is NULL, a label in the form "node0", "node1", etc. will automatically be generated. Name can be
any string. Labels are non-unique. A parent can contain two nodes with the same label. Nodes can be relabeled using Blt_TreeRe-
labelNode.
position Position the parent's list of children to insert the new node. For example, if position is 0, then the new node is prepended to
the beginning of the list. If position is -1, then the node is appended onto the end of the parent's list.
RETURNS
The new node returned is of type Blt_TreeNode. It's a token that can be used with other routines to add/delete data values or children
nodes.
EXAMPLE
The following example creates a new node from the root node.
Blt_Tree token;
Blt_TreeNode root, node;
if (Blt_TreeGetToken(interp, "myTree", &token) != TCL_OK) {
return TCL_ERROR;
}
root = Blt_TreeRootNode(token);
node = Blt_TreeCreateNode(token, root, "myNode", -1);
NOTIFICATIONS
Blt_TreeCreateNode can trigger tree notify events. You can be notified whenever a node is created by using the Blt_TreeCreateNotifyHan-
dler. A callback routine is registered that will be automatically invoked whenever a new node is added via Blt_TreeCreateNode to the tree.
KEYWORDS
tree, token
BLT
2.4 Blt_TreeCreateNode(3)