If McDonalds were run like a software company, one out of every hundred Big Macs would give you food poisoning, and the response would be, ‘We’re sorry, here’s a coupon for two more.’ “ Mark Minasi

Flattening a Linked List

Language Java | Level Intermediate | Category Data structure | September 5, 2015 11:51 pm


Data structure Description

Write a program to flatten the linked list into singly linked list. The linked list may contain many list with two-dimensional array. The program should convert to singly linked list.


Output

   					 

Nested list of elements: [1, [2, [3, 4]], [5, 6, 7], 8, [[9, 10]]]
After remove flat list: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

				    

Comments


No comments available!

Please login to add comments.