+ 2
data in lists
can we put different type of data in list? e.g first node as int and second node as string
2 Answers
+ 6
If you are talking about python: Yes itâs possible. list could be:
lst = []
lst.append(1)
lst.append([2, 3, 4])
lst.append('red')
# result is:
[1, [2, 3, 4], 'red']
+ 3
not sure which language but yes you can... as most languages work very much alike.
Here is one resource as an example of your question...
https://beginnersbook.com/2013/12/linkedlist-in-java-with-example/