avi.jasu01
BAN USERpackage LinkedList;
import java.util.LinkedList;
public class LinkedListNode {
int value;
LinkedListNode next = null;
public LinkedListNode(int i) {
this.value = i;
}
public LinkedListNode addNode(int i) {
this.next = new LinkedListNode(i);
return next;
}
public LinkedListNode getNext() {
return next;
}
@Override
public String toString() {
String restElement = value+"->";
LinkedListNode newNext = getNext();
while(newNext != null)
{restElement = restElement + newNext.value + "->";
newNext = newNext.getNext();}
restElement = restElement +newNext;
return restElement;
}
public static void main(String[] args) {
LinkedListNode headnode = new LinkedListNode(1);
headnode.addNode(2)
.addNode(3)//.addNode(4).addNode(5).addNode(6)
;
System.out.println(headnode);
headnode = reverse(null,headnode,headnode.getNext());
System.out.println(headnode);
}
private static LinkedListNode reverse(LinkedListNode prev, LinkedListNode current, LinkedListNode next) {
current.setNext(prev);
if(next == null)
return current;
return reverse(current,next,next.getNext());
}
private void setNext(LinkedListNode prev) {
this.next = prev;
}
}
RepLaylaLee, abc at AMD
Creative and dedicated photo editor with experience in photojournalism and marketing material development. I like to explore Best tantrik in ...
Repreiviasmith, Malwarebytes customer service at ABC TECH SUPPORT
I am Reivia an outgoing and motivated Travel Consultant with over 5 years of experience in delivering professional travel related ...
RepDaisyRoss, Video game designer at A9
Seeking lead game programmer and position to utilize knowledge and skills to advance portfolio and potential for increased responsibility. Explore ...
RepAidenKim, business planner manager at GPU
Expert business strategist with a sound understanding of organizational development and sales. Persuasive negotiator who uses integrity and professionalism in ...
RepChloePerez, cashier at POS
Versatile cashier with exemplary cash register system skills and proven commitment to store cleanliness and safely. Learning new and knowledgeable ...
RepZoeyUhl, abc at 247quickbookshelp
With a highly experienced law clerk, well respected and writing proficient, detail oriented and proficient in preparing legal memos of ...
1. var prefix = "";
- avi.jasu01 February 15, 20172. var readline <-- read new line from file and repeat from step 3 to ....
3. if readline contain pattern [] then
3.1 var readline= readline without [ and ]
3.2 var prefix = prefix+(prefix.size==0 ? "" : ".")+readline;
4 else if readline contain pattern [/] then set prefix = substr(prefix,0,last index of "." - 1)
5 else
5.1 str[] = split readline on "="
5.2 var key = prefix + "." + str[0]
5.3 var value = str[1]
5.4 stroe key value pair into hashmap so that value can be retrived from hashmap on given key like employee.name