(c) language
What is the code that is required to define the node and the header for a linked list of the ages of your family members in decreasing order along with the name you refer to that person as (the nickname e.g. dad 59). Specify only the typedef of the node and the declaration of the header.
YOU DO NOT NEED THE CODE To make the linked list.
you must use the dictionary type inside the list.
Using the dictionary you can add the multipal key and value link age is 50 (age = 50) in the list. Or start the first node with higher age person (like dad).
Here I am give some code In python It help in solution.
Code :
d = list()
a1 = {'age' : 50,'name':'father'}
a2 = {'age' : 48,'name':'mother'}
a3 = {'age' : 25,'name':'son'}
d.append(a1)
d.append(a2)
d.append(a3)
print(d)
print('\n-------------\n')
print(d[0])
print(d[2]['age'])
print(d[2]['name'])
output : -
[{'age': 50, 'name': 'father'}, {'age': 48, 'name': 'mother'}, {'age': 25, 'name': 'son'}]
-------------
{'age': 50, 'name': 'father'}
25
son
ScreenShot :
Get Answers For Free
Most questions answered within 1 hours.