-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpract_01.c
More file actions
75 lines (64 loc) · 1.96 KB
/
pract_01.c
File metadata and controls
75 lines (64 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#include "python_functions.c"
int main()
{
// char *name;
// int a = 0;
// name = python_input("Enter number : ");
// printf("%s", name);
node *l, *l2;
int n = atoi(python_input("Length of nodes : "));
l = create_list(n);
printList(l);
printf("\n\t - - Length of array = %d\n", python_len(l));
/*
l= python_insert(l, atoi(python_input("Enter Value to be inserted : ")), atoi(python_input("At index : ")));
printf("\nAfter inserting\n");
printList(l);
printf("\n\t - - Length of array = %d\n", python_len(l));
l = python_remove(l, atoi(python_input("Remove from index : ")));
printList(l);
printf("\n\t - - Length of array = %d", python_len(l));
*/
l = python_reverse(l);
printList(l);
// printf("\nDeleting list \n");
// printList(python_deleteList(l));
// printf("Clear list");
// l = python_clearList(l);
// printList(l);
printf("\nAppending -- \n");
for (int i = 0; i<3; i++)
{
l = python_append(l, 6);
}
printList(l);
printf("\n -- Counting %d", python_count(l, 6));
printf("\n sorting --- \n");
l = python_sort(l);
printList(l);
printf("\nMaking new list\n");
// node *l2;
l2 = create_list(atoi(python_input("Enter length of list : ")));
printf("\nAppending -- \n");
for (int i = 0; i<3; i++)
{
l2 = python_append(l2, atoi(python_input("Enter a value : ")));
}
printf("List 2 : ");printList(l2);
printf("List 1 : ");printList(l);
getchar();
node *l3;
l3 = concat(l, l2);
printf("List 1 : ");printList(l);
printf("List 2 : ");printList(l2);
printf("List 3 : ");printList(l3);
// printf("\nUnique values ONLY -- \n");
// l = unique(l);
// printList(l);
// printf("Making new list\n");
// l2 = create_list(6);
// printList(l);
// printf("\nNew list");
// getchar();
return 0;
}