Skip to content
Advertisement

Tag: data-structures

implementation of LinkedList without last node

I have been asked to re-implement a linked list without the use of a tail. So I have to change its methods so it can work without using a tail node. The removeLast method confused me: here is what I tried to do, but it didn’t remove the node. What is wrong with my attempt? Test class Answer You need

Infix to Postfix short trick

Does anybody know a shortcut or short trick for infix to postfix conversion for multiple-choice questions exam? I know the method using stack but is there any fast technique for it? for example a+b*(c^d-e)^(f+gh)-i to abcd^e-fgh+^*+i- Answer Write the expression as a tree (leaves are values, internal nodes are operators), preserving the left-to-right order of values, and then write down

Advertisement