Hi, Could anyone help me with a method for a Singly Linked List which gets fifth element from last linked list I have the logic here: 1) have two ptrs. F_Ptr & S_Ptr. 2) Let the ptrs point to the START. 3) Take n as the offset. 4) Start traversing the S_Ptr after the F_Ptr after n. suppose you want to ...
If you don't care about a distinction between how {a, a, b, c} matches {a, c} vs. how {a, b, c} matches {a, c} (that is, if you don't need to distinctly count multiple matches of the same string), then the simplest and fastest thing to do would be to put both Lists into HashSets and then call set1.retainAll(set2). This will ...
hi, I need to make up a data structure such that it has 2 data elements, first one is a unique ID seconds data element is a set structure. What I need to do is first look up @ the ID to see if any matching entries are found, if so then the data is added to the 2nd set of ...
I'm trying to shuffle elements in a linked list without using another linked list or array. I'm supposed to manipulate the linked list directly. I'm completely stumped as to how I'd go about doing this. In my node class I only have 4 methods ( setItem(), setNext(), getNext(), and getItem() ) Some guidance would be appreciated =)