MTECH-LinkedList


Submit solution

Points: 10
Time limit: 10.0s
Memory limit: 64M

Author:
Problem type
Allowed languages
Java, Python

Implement the Linked List with the following functions:

a.  Function to return the number of elements with O(1) complexity
                  Linked list to be printed 
b.  Function to print the last element with O(1) complexity
c.  Function to enqueue front with O(1) complexity
                  Linked list to be printed 
d.  Function to remove the even elements (refers the positions) with O(n/2) complexity
(print function)
SampleInput:
string
6
EF  Google.com #enque front 
EF  yahoo.com #enque front 
S  #size or length of the linked list
PL # print last element
RE  #remove even elements(position)
S #size or length of the linked list
SampleOutput:
Google.com->null
Yahoo.com->Google.com->null
2
Google.com
Yahoo.com->null
1

Comments

There are no comments at the moment.