MCPcopy Create free account
hub / github.com/SR-Sunny-Raj/Hacktoberfest2021-DSA / create

Function create

10. Linked List/cpp/BasicoperationsonDLL.cpp:16–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14 }
15} *head = NULL, *tail = NULL;
16void create()
17{
18 int n;
19 cout << "Enter number of nodes. ";
20 cin >> n;
21 for (int i = 0; i < n; i++)
22 {
23 int x;
24 cout << "Enter the value of element " << i + 1 << " ";
25 cin >> x;
26 node *cur = new node(x);
27 if (head == NULL)
28 {
29 head = tail = cur;
30 }
31 else
32 {
33 cur->prev = tail;
34 tail->next = cur;
35 tail = cur;
36 }
37 }
38}
39int cnoe(node *head)
40{
41 int count = 0;

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected