israAzul
BAN USER
Israel López
México, City. Email: israazul@gmail.com
Mexican Citizen Cell Phone: +52 1 5532755830
Employment History:
Java Back End Developer Adesis, Mexico, city. 07/2015 – 04/2016
• Proposed and executed the refactoring of the module from carś insurance.
• Found out and Corrected bugs in the Production and the Test systems.
Java Consultant ITE soluciones/ Merck Sharp & Dohme, Mexico, city. 04/2014 – 06/2015
• Proposed and Created web services for integration with another system in glassfish and created web services clients.
Java Senior Developer Global Hitss, Mexico, City. 07/2013 – 04/2014
• Responsible for developing new module of taxes for the Stock Exchange of Mexico, (BMV).
Java EE Developer Tasi Software/EMD Merck, Mexico, City. 10/2011- 04/2013
• Participated and leaded the creation of the project Merck Trusts for sales representatives with Java.
Java EE Developer SoulTech, Mexico, City. 11/2009- 10/2011
• Created a series of stored procedures and functions on Informix for complete the process of all the payroll of workers from the Institute for Social Security and Services for State Workers.
• Developed the new module for registering a medical note from the IMSS.
Education:
B. S. in Computer Science, 2009. National Autonomous University of Mexico, Mexico, City.
Java SE 6 Programmer certified, Scrum Master Certified (SMC).
Technology Summary
Programming : Java, XML, SQL, JavaScript, PHP
Framework : Hibernate, Java Server Faces, Spring, ADF, IReport, Lotus Notes, EJB, Web Services (SOAP and Rest), JUnit, Log4j, mockito, EclEmma, Mybatis, apache cxf, sonarqube.
Databases : MySQL, Oracle, Informix, NoSQL (course)
UI/UX : JavaScript, JQuery, Ajax, Angular (course), grunt, HTML, CSS, JSon, EasyUi, Rich Faces, Prime Faces
Build, Version Controls, CI : Maven, SVN, Git, Mercurial
Systems : Linux (SUSE, Ubuntu), Windows
App. Servers : Weblogic 6.2, Glassgish 3, Tomcat
Software : Eclipse, Net Beans, Jdeveloper.
package test;
public class AmazonParseInt {
public static void main(String[] args) {
String strInput = new String (""+2356789);
process (strInput);
}
public static void process (String str){
int resultado = 0, maxDigits;
int aux = 1;
int auxMultiply = aux;
for (int index=0; index<str.length(); index++){
aux = aux * 10;
}
resultado = aux;
maxDigits= aux;
for (int index=0; index<str.length(); index++){
aux = aux / 10;
auxMultiply = (Integer.valueOf(str.substring(index, index+1)) ) *aux;
resultado = resultado + auxMultiply ;
}
resultado = resultado -maxDigits ;
System.out.println(resultado);
}
}
package test;
public class AmazonMostSolidPrice {
Data [] bucketsData = new Data[10];
int number = 1;
public static void main(String[] args) {
AmazonMostSolidPrice amazonMostSolidPrice = new AmazonMostSolidPrice();
amazonMostSolidPrice.addData(10.01d, 100);
amazonMostSolidPrice.addData(11.01d, 200);
amazonMostSolidPrice.addData(10.01d, 210);
amazonMostSolidPrice.dump();
}
void dump() {
System.out.println();
for (int i = 0; i < number; i++) {
System.out.print(i + ":");
Data list = bucketsData[i];
while (list != null) {
System.out.print(" (" + list.price + "," + list.quantity + ")");
list = list.next;
}
System.out.println();
}
}
public class Data {
double price;
int quantity;
Data next = null;
Data(double priceRec, int qty){
price = priceRec;
quantity = qty;
}
public boolean equals(Object object){
if (object instanceof Data){
return price == ( ((Data) object).price);
}
return false;
}
}
private void addData(double priceRec, int qty){
Data newData = new Data(priceRec, qty);
int indexData = 0;
Data data = bucketsData[indexData];
if (data!=null){
while (data !=null ){
if(newData.equals(data)){
newData.quantity = newData.quantity + data.quantity;
data.quantity = newData.quantity;
return;
}
else
data = data.next;
}
newData.next= bucketsData[indexData] ;
bucketsData[indexData] = newData;
}else{
bucketsData[indexData] = newData;
}
}
}
package test;
public class AmazonMostSolidPrice {
Data [] bucketsData = new Data[5000];
int[] numbers= new int[5000];
int number;
public static void main(String[] args) {
AmazonMostSolidPrice amazonMostSolidPrice = new AmazonMostSolidPrice();
amazonMostSolidPrice.addData(10.01d, 100);
amazonMostSolidPrice.addData(11.01d, 200);
amazonMostSolidPrice.addData(10.01d, 210);
amazonMostSolidPrice.show();
}
private void show (){
for (int i=0;i<number;i++){
System.out.println(bucketsData[numbers[i]].price + ":"+bucketsData[numbers[i]].quantity);
}
}
public class Data {
double price;
int quantity;
Data(double priceRec, int qty){
price = priceRec;
quantity = qty;
}
}
private void addData(double priceRec, int qty){
Data newData = new Data(priceRec, qty);
int indexData = hash(priceRec);
Data data = bucketsData[indexData];
if (data!=null){
newData.quantity = newData.quantity + data.quantity;
bucketsData[indexData] = newData;
}else{
bucketsData[indexData] = newData;
numbers[number]=indexData;
number++;
}
}
private int hash(double key){
StringBuilder sb = new StringBuilder();
for (String str: String.valueOf(key).split("\\.")){
sb.append(str);
}
return Integer.valueOf(sb.toString()) ;
}
}
package test;
import java.util.ArrayList;
import java.util.TreeMap;
import java.util.Map.Entry;
public class AmazonCarMaxRental {
public static void main(String[] args) {
CarRental<String> carRental1 = new CarRental<String>("car1", 1, 5);
CarRental<String> carRental2 = new CarRental<String>("car2", 5, 6);
CarRental<String> carRental3 = new CarRental<String>("car3", 6, 9);
CarRental<String> carRental4 = new CarRental<String>("car4", 4, 5);
ArrayList<CarRental<String>> list = new ArrayList<>();
list.add(carRental1);
list.add(carRental2);
list.add(carRental3);
list.add(carRental4);
process( list);
}
private static void process(ArrayList<CarRental<String>> list){
TreeMap<Integer, Integer> mapTotal = new TreeMap<>();
for (CarRental<String> carRental: list){
int index = carRental.start;
while(index<=carRental.fin){
if (mapTotal.containsKey(index) )
mapTotal.put(index, mapTotal.get(index)+1);
else
mapTotal.put(index, 1);
index++;
}
}
Entry<Integer, Integer> entryMax= mapTotal.firstEntry();
for (Entry<Integer, Integer> entryMap: mapTotal.entrySet()){
int value=entryMap.getValue();
int keyFirst = entryMax.getValue();
if (value > keyFirst)
entryMax = entryMap;
}
System.out.println(entryMax);
}
static class CarRental <T>{
T car;
int start;
int fin;
public CarRental (T car, int start, int fin){
this.car = car;
this.start = start;
this.fin = fin;
}
public int getDistance(){
return fin-start;
}
}
}
package test;
import java.util.Arrays;
import java.util.Iterator;
import java.util.LinkedHashSet;
public class AmazonUniqueRows {
Node[] buckets = new Node[2];
int numberBuckets, size;
private static class Node {
int value;
int key;
Node next = null;
public Node (int value, int key){
this.key = key;
this.value = value;
}
}
public void add (int key, int value ){
int indexHash = hash( key);
Node node = buckets[indexHash];
Node newNode = new Node(value, key);
if (node == null){
buckets[indexHash] = newNode;
numberBuckets ++;
size ++;
}else{
while (node.next!=null){
node = node.next;
}
node.next = newNode;
size ++;
}
if (numberBuckets == buckets.length){
rehash();
}
}
private void rehash() {
Node[] bucketsResize = new Node[numberBuckets*2];
int counter = 0;
for (Node node:buckets ){
bucketsResize[counter++] = node;
}
buckets = bucketsResize;
}
void dump() {
int[] finalMatriz = new int[size];
int counterMatriz =0;
for (int i = 0; i < numberBuckets; i++) {
Node list = buckets[i];
while (list != null) {
finalMatriz[counterMatriz++] = list.value;
list = list.next;
}
}
System.out.println(Arrays.toString(finalMatriz));
}
public int hash(int key){
return key;
}
public static void main(String[] args) {
process();
}
private static void process (){
LinkedHashSet<int[]> set = new LinkedHashSet<int[]>();
int[] arrayOne = new int[3];
int[] arrayTwo = new int[3];
int[] arrayThree = new int[4];
int[] arrayFive = new int[2];
arrayOne[0]= 1;
arrayOne[1] = 3;
arrayOne[2] = 4;
arrayTwo[0]= 20;
arrayTwo[1] = 12;
arrayTwo[2] = 14;
arrayThree[0]= 19;
arrayThree[1] = 35;
arrayThree[2] = 46;
arrayThree[3] = 27;
arrayFive[0]= 50;
arrayFive[1] = 16;
set.add(arrayOne);
set.add(arrayTwo);
set.add(arrayThree);
set.add(arrayFive);
Iterator<int[]> iterator = set.iterator();
int counter = 0;
AmazonUniqueRows amazonUniqueRows = new AmazonUniqueRows();
while (iterator.hasNext()){
int[] arrayIt = iterator.next();
for (int number: arrayIt){
amazonUniqueRows.add(counter, number);
}
counter++;
}
amazonUniqueRows.dump();
}
}
package test;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
public class AmazonExistsPath {
public static void main(String[] args) {
GraphExistentPath graphExistentPath = new GraphExistentPath();
int [][] matriz = new int[5][4];
for (int cols=0;cols<4;cols++){
for (int rows=0;rows<5;rows++){
if ( (cols==1 && rows ==1) || (rows==2 && cols ==1) || (rows==4 && cols ==2) )
{
matriz[rows][cols]=1;
graphExistentPath.addVertex(""+rows+cols, false);
}else
{
matriz[rows][cols]=0;
graphExistentPath.addVertex(""+rows+cols, true);
}
}
}
for (int indexVetex=0;indexVetex<20;indexVetex++){
System.out.println(graphExistentPath.getVextex(indexVetex));
}
int starti = 3, startj=1, finj=2, fini=0;
addNeighbor( graphExistentPath);
System.out.println(graphExistentPath.reviewPathExists(new String(""+starti+startj), new String(""+finj+fini)));
}
private static void addNeighbor(GraphExistentPath graphExistentPath){
for (int indexVetex=0;indexVetex<20;indexVetex++){
try{
graphExistentPath.addNeighbor(indexVetex, graphExistentPath.getVextex(indexVetex-1));
}catch(Exception e){
}
try{
graphExistentPath.addNeighbor(indexVetex, graphExistentPath.getVextex(indexVetex+1));
}catch(Exception e){
}
try{
graphExistentPath.addNeighbor(indexVetex, graphExistentPath.getVextex(indexVetex+5));
}catch(Exception e){
}
try{
graphExistentPath.addNeighbor(indexVetex, graphExistentPath.getVextex(indexVetex-5));
}catch(Exception e){
}
}
System.out.println("graphExistentPath "+graphExistentPath.adjList);
}
}
class StackExistentPath
{
private final int SIZE = 20;
private int[] stack;
private int top;
public StackExistentPath()
{
stack = new int[SIZE]; // make array
top = -1;
}
public void push(int j) // put item on stack
{
stack[++top] = j; }
public int pop() // take item off stack
{
stack[top] = -1;
return stack[top--]; }
public int peek() // peek at top of stack
{
return stack[top];
}
public boolean isEmpty() // true if nothing on stack
{
return (top == -1); }
}
class VertexExistentPath
{
public String label; // label (e.g. 'A')
public boolean active;
public boolean wasVisited;
public VertexExistentPath(String lab, boolean active)
{
label = lab;
this.active = active;
wasVisited = false;
}
public String toString(){
return label+" "+active;
}
}
class GraphExistentPath
{
private final int MAX_VERTS = 20;
private VertexExistentPath vertexList[];
private int numberVerts;
private int indexListAdjacent;
private StackExistentPath theStack;
Map<Integer, LinkedList<VertexExistentPath>> adjList;
TreeMap<String, Integer> shortestPath = new TreeMap<String, Integer>();
public GraphExistentPath()
{
vertexList = new VertexExistentPath[MAX_VERTS];
numberVerts = 0;
indexListAdjacent = 0;
theStack = new StackExistentPath();
adjList = new HashMap<Integer, LinkedList<VertexExistentPath>>();
}
public void addVertex(String lab, boolean active)
{
VertexExistentPath vertexExistentPath=new VertexExistentPath(lab, active);
vertexList[numberVerts++] = vertexExistentPath;
adjList.put(indexListAdjacent++, new LinkedList<VertexExistentPath>());
}
public void addNeighbor(int v1, VertexExistentPath v2) {
if (v2!=null)
adjList.get(v1).add(v2);
}
public List<VertexExistentPath> getNeighbors(int v1) {
return adjList.get(v1);
}
public VertexExistentPath getVextex(int index)
{
return vertexList[index].active?vertexList[index]:null;
}
public void displayVertex(int v)
{
System.out.print(vertexList[v].label);
}
public boolean reviewPathExists(String vertixBase, String vertixToFind) // depth-first search
{
int indexVertixBase = findIndexVertex(vertixBase);
int indexVertixToFind = findIndexVertex(vertixToFind);
int counterDepth = 0;
int vertexUnvisited = -1;
StringBuilder chainCharofGrahp = new StringBuilder();
if (indexVertixBase > -1){
vertexList[indexVertixBase].wasVisited = true;
theStack.push(indexVertixBase);
counterDepth++;
chainCharofGrahp.append(vertixBase+"-");
while( !theStack.isEmpty() )
{
vertexUnvisited = getUnvisitedNeighbor( theStack.peek() );
if(vertexUnvisited == -1)
theStack.pop();
else
{
counterDepth++;
chainCharofGrahp.append(vertexList[vertexUnvisited].label+"-");
//System.out.println("label "+vertexList[vertexUnvisited].label);
if (vertexUnvisited == indexVertixToFind){
shortestPath.put(chainCharofGrahp.toString(), counterDepth);
chainCharofGrahp = new StringBuilder();
counterDepth = 0;
break;
}
vertexList[vertexUnvisited].wasVisited = true; // mark it
theStack.push(vertexUnvisited); // push it
}
}
for(int j=0; j<numberVerts; j++)
vertexList[j].wasVisited = false;
}
return !shortestPath.isEmpty();
}
private int findIndexVertex(String labelVertex){
for (int i=0; i<vertexList.length;i++){
if( vertexList[i].label.equalsIgnoreCase(labelVertex) ){
return i;
}
}
return -1;
}
public int getUnvisitedNeighbor(int v1) {
String key = null;
for ( VertexExistentPath vertexExistentPath: adjList.get(v1) ){
if (vertexExistentPath.active && !vertexList[findIndexVertex(vertexExistentPath.label)].wasVisited){
key = vertexExistentPath.label;
break;
}
}
return findIndexVertex(key);
}
}
package test;
import java.util.Arrays;
public class AmazonReverseSubSet {
public static void main(String[] args) {
int[] x = { 9, 2, 4, 7, 3, 7, 12, 15, 10 };
int n = 4;
process (x, n);
}
public static void process (int[] array, int n){
int indexRight=n-1;
int totalIterations= (n/2);
for (int left=0,rigth=totalIterations; rigth>0 && left<array.length;left++,rigth-- ){
int aux= array[indexRight];
array[indexRight] = array[left];
array[left] = aux;
indexRight--;
}
System.out.println(Arrays.toString(array));
}
}
package test;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
public class AmazonSetAnagrams {
NodeAnagram[] buckets = new NodeAnagram[8];
public static void main(String[] args) {
Set<String> setAnagrams = new HashSet<String>();
setAnagrams.add("star");
setAnagrams.add("dogs");
setAnagrams.add("rats");
setAnagrams.add("car");
setAnagrams.add("rac");
setAnagrams.add("rtsa");
AmazonSetAnagrams amazonSetAnagrams = new AmazonSetAnagrams();
process (setAnagrams, amazonSetAnagrams);
Set<ArrayList<String>> setList = new HashSet<ArrayList<String>>();
for (int index =0;index<amazonSetAnagrams.buckets.length;index++){
ArrayList<String> listStrings = new ArrayList<String>();
NodeAnagram base= amazonSetAnagrams.buckets[index];
while (base != null){
listStrings.add(base.value);
base = base.next;
}
if (!listStrings.isEmpty()){
setList.add(listStrings);
}
}
for (ArrayList<String> arrayList:setList){
System.out.print("(");
for (int index =0;index<arrayList.size();index++){
String base= arrayList.get(index);
System.out.print(base +" ");
}
System.out.println(")");
}
}
private static class NodeAnagram {
String value;
NodeAnagram next = null;
public NodeAnagram (String value){
this.value = value;
}
public String toString(){
return value;
}
}
public void addNodeAnagram(String word){
int position = hash(word);
NodeAnagram node = buckets[position];
NodeAnagram newNode = new NodeAnagram(word);
if (node == null){
buckets[position] = newNode;
}else{
newNode.next = buckets[position];
buckets[position] = newNode;
}
}
private int hash(String word) {
int result = 0;
for (int index=0; index<word.length(); index++){
result = result+word.charAt(index);
}
NodeAnagram previoBucket = buckets[result % buckets.length];
if (previoBucket!=null){
while (previoBucket != null){
if (reviewAnagram(word, previoBucket.value))
previoBucket = previoBucket.next;
}
}
return result % buckets.length;
}
private boolean reviewAnagram(String newString, String strPrevioBucket){
char ch1[] = newString.toCharArray();
char ch2[] = strPrevioBucket.toCharArray();
Arrays.sort(ch1);
Arrays.sort(ch2);
if (ch1.length != ch2.length){
return false;
}
return Arrays.equals(ch1, ch2);
}
public static void process (Set<String> setAnagrams, AmazonSetAnagrams amazonSetAnagrams){
Iterator<String> iterator = setAnagrams.iterator();
while (iterator.hasNext()){
String word = iterator.next();
checkAnagram ( word, amazonSetAnagrams ) ;
}
}
private static void checkAnagram (String word, AmazonSetAnagrams amazonSetAnagrams ){
amazonSetAnagrams.addNodeAnagram( word);
}
}
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map.Entry;
public class AmazonLogged {
public static void main(String[] args) {
String input = "user1, user4, user2, user1, user3, user1, user2, user3";
int key = 2;
process ( input, key );
}
public static void process (String input, int key ){
HashMap<String, Integer> hashMap = new HashMap<>();
for (String strSplit : input.split(",") ){
strSplit = strSplit.trim();
if (hashMap.containsKey(strSplit)){
hashMap.put(strSplit, hashMap.get(strSplit).intValue()+1);
}else{
hashMap.put(strSplit, 1);
}
}
Iterator<Entry<String, Integer>> iterator= hashMap.entrySet().iterator();
while (iterator.hasNext()){
Entry<String, Integer> entry= iterator.next();
if (entry.getValue() !=key)
{
iterator.remove();
}else
System.out.println(entry.getKey() + " "+key);
}
}
}
public class AmazonJumbledNumber {
public static void main(String[] args) {
String input = "123456789";
System.out.println(process (input));
}
private static boolean process (String input){
int index = 0;
while (index < input.length()-1 ) {
int number = Integer.valueOf(input.substring(index, index+1));
int numberTwo = Integer.valueOf(input.substring(++index, index+1));
if (number+1 != (numberTwo ) && number-1 != (numberTwo ) ){
return false;
}
}
return true;
}
}
package test;
import java.util.Map.Entry;
import java.util.TreeMap;
public class GoogleShortestPaths {
public static void main(String[] args) {
GraphDFS theGraph = new GraphDFS();
theGraph.addVertex('A'); // 0 (start for dfs)
theGraph.addVertex('B'); // 1
theGraph.addVertex('C'); // 2
theGraph.addVertex('D'); // 3
theGraph.addVertex('E'); // 4
theGraph.addVertex('R'); // 5
theGraph.addVertex('S'); // 6
theGraph.addEdge(0, 1); // AB
theGraph.addEdge(1, 2); // BC
theGraph.addEdge(0, 3); // AD
theGraph.addEdge(3, 4); // DE
theGraph.addEdge(3, 2); // DC
theGraph.addEdge(5, 0); // RB
theGraph.addEdge(5, 6); // RS
theGraph.addEdge(6, 2); // SC
theGraph.dfs('A', 'C'); // depth-first search
theGraph.deleteMaxPathOfMap();
System.out.println("shortestPath "+theGraph.shortestPath);
}
}
class StackDFS
{
private final int SIZE = 20;
private int[] stack;
private int top;
// ------------------------------------------------------------
public StackDFS() // constructor
{
stack = new int[SIZE]; // make array
top = -1;
}
// ------------------------------------------------------------
public void push(int j) // put item on stack
{
stack[++top] = j; }
// ------------------------------------------------------------
public int pop() // take item off stack
{
stack[top] = -1;
return stack[top--]; }
// ------------------------------------------------------------
public int peek() // peek at top of stack
{
return stack[top];
}
// ------------------------------------------------------------
public boolean isEmpty() // true if nothing on stack
{
return (top == -1); }
// ------------------------------------------------------------
} // end class StackX
////////////////////////////////////////////////////////////////
class VertexDFS
{
public char label; // label (e.g. 'A')
public boolean wasVisited;
// ------------------------------------------------------------
public VertexDFS(char lab) // constructor
{
label = lab;
wasVisited = false;
}
// ------------------------------------------------------------
} // end class Vertex
////////////////////////////////////////////////////////////////
class GraphDFS
{
private final int MAX_VERTS = 20;
private VertexDFS vertexList[]; // list of vertices
private int adjacencyMatrix[][]; // adjacency matrix
private int numberVerts; // current number of vertices
private StackDFS theStack;
TreeMap<String, Integer> shortestPath = new TreeMap<String, Integer>();
public GraphDFS() // constructor
{
vertexList = new VertexDFS[MAX_VERTS];
// adjacency matrix
adjacencyMatrix = new int[MAX_VERTS][MAX_VERTS];
numberVerts = 0;
for(int y=0; y<MAX_VERTS; y++) // set adjacency
for(int x=0; x<MAX_VERTS; x++) // matrix to 0
adjacencyMatrix[x][y] = 0;
theStack = new StackDFS();
} // end constructor
public void addVertex(char lab)
{
vertexList[numberVerts++] = new VertexDFS(lab);
}
public void addEdge(int start, int end)
{
adjacencyMatrix[start][end] = 1;
adjacencyMatrix[end][start] = 1;
}
public void dfs(char vertixBase, char vertixToFind) // depth-first search
{
int indexVertixBase = findIndexVertex(vertixBase);
int indexVertixToFind = findIndexVertex(vertixToFind);
int counterDepth = 0, vertexUnvisited = -1;
StringBuilder chainCharofGrahp = new StringBuilder();
if (indexVertixBase > -1){
while (getIndexAdjUnvisitedVertex( indexVertixBase ) > -1 ){
vertexList[indexVertixBase].wasVisited = true;
theStack.push(indexVertixBase);
counterDepth++;
chainCharofGrahp.append(vertixBase);
while( !theStack.isEmpty() ) // until stack empty,
{
// get an unvisited vertex adjacent to stack top
vertexUnvisited = getIndexAdjUnvisitedVertex( theStack.peek() );
if(vertexUnvisited == -1) // if no such vertex,
theStack.pop();
else // if it exists,
{
counterDepth++;
chainCharofGrahp.append(vertexList[vertexUnvisited].label);
System.out.println("label "+vertexList[vertexUnvisited].label);
if (vertexUnvisited == indexVertixToFind){
shortestPath.put(chainCharofGrahp.toString(), counterDepth);
chainCharofGrahp = new StringBuilder();
counterDepth = 0;
break;
}
vertexList[vertexUnvisited].wasVisited = true; // mark it
theStack.push(vertexUnvisited); // push it
}
}
}
// stack is empty, so we're done
for(int j=0; j<numberVerts; j++) // reset flags
vertexList[j].wasVisited = false;
}
}
// returns an unvisited vertex adj to v
public int getIndexAdjUnvisitedVertex(int peekStack)
{
for(int j=0; j<numberVerts; j++)
if(adjacencyMatrix[peekStack][j]==1 && vertexList[j].wasVisited==false)
return j;
return -1;
}
private int findIndexVertex(char vertixBase){
for (int i=0; i<vertexList.length;i++){
if( vertexList[i].label == vertixBase){
return i;
}
}
return -1;
}
public void deleteMaxPathOfMap(){
Entry<String, Integer> entry= shortestPath.firstEntry();
int keyMinumun = entry.getValue();
for (Entry<String, Integer> entryMap: shortestPath.entrySet()){
int value=entryMap.getValue();
if (value > keyMinumun)
shortestPath.remove(entryMap.getKey());
}
}
} // end class Graph
package test;
public class GoogleFindTwoNodesTree {
Node root;
int size = 0;
private class Node {
int key;
String name;
Node leftChild;
Node rightChild;
Node(int key, String name) {
this.key = key;
this.name = name;
}
public String toString() {
return name + " has the key " + key;
}
}
public void addNode(int key, String name){
Node node = root;
Node newNode = new Node(key, name);
// If there is no root this becomes root
if (root == null) {
root = newNode;
size++;
} else {
while (true){
if (node.key > newNode.key){
if (node.leftChild !=null){
node = node.leftChild;
}else{
node.leftChild = newNode;
size++;
return;
}
}else{
if (node.rightChild !=null){
node = node.rightChild;
}
else{
node.rightChild = newNode;
size++;
return;
}
}
}
}
}
public boolean FindDeephNodesIfExists(Node root, int keyOne, int keyTwo){
int nodeOne = findTwoNodes(root, keyOne, true);
int nodeTwo = findTwoNodes(root, keyTwo, false);
return nodeOne==nodeTwo?true:false;
}
public int findTwoNodes (Node root, int key, boolean isLeftNodeToFind) {
Node node = root;
int depth = -1;
boolean isRigth = false;
if (root == null) {
return -1;
} else {
while (node.key != key){
if (node.key > key){
node = node.leftChild;
isRigth = false;
}else{
node = node.rightChild;
isRigth = true;
}
if (node == null)
return -1;
++depth;
}
if (isRigth && isLeftNodeToFind){
depth = -1;
}
return ++depth;
}
}
public Node findNode(int key) {
Node node = root;
if (root == null) {
return null;
} else {
while (node.key != key){
if (node.key > key){
node = node.leftChild;
}else{
node = node.rightChild;
}
if (node == null)
return null;
}
return node;
}
}
public static void main(String[] args) {
GoogleFindTwoNodesTree theTree = new GoogleFindTwoNodesTree();
theTree.addNode(50, "Boss");
theTree.addNode(25, "Vice President");
theTree.addNode(15, "Office Manager");
theTree.addNode(30, "Secretary");
theTree.addNode(75, "Sales Manager");
theTree.addNode(85, "Salesman 1");
// System.out.println(theTree.findNode(75));
Node rootForSearch = theTree.findNode(50);
System.out.println(theTree.FindDeephNodesIfExists(rootForSearch, 25, 75));
}
}
package test;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
public class InterleaveIterator<E> implements Iterator<E> {
List<Iterator<E>> listIterator = null;
int rows = 0;
int columns = 0;
int totalListsOfIterator = -1;
E next;
Iterator<E> iterator ;
int maximunSizeList = 5;
InterleaveIterator(List<Iterator<E>> listIter){
listIterator = listIter;
totalListsOfIterator = listIterator.size();
}
public static void main(String[] args) {
Collection<Object> listIntegers = new ArrayList<Object>();
listIntegers.add(1);
listIntegers.add(2);
listIntegers.add(3);
listIntegers.add(4);
List listTwo = new ArrayList<String>();
listTwo.add("Str1");
listTwo.add("Str2");
listTwo.add("Str3");
listTwo.add("Str4");
listTwo.add("Str5");
ArrayList<Object> i3 = new ArrayList<Object>();
i3.add(111);
i3.add(112);
i3.add(113);
i3.add(114);
i3.add(115);
i3.add(116);
i3.add(117);
i3.add(118);
List<Iterator<Object>> listIterator = new ArrayList<Iterator<Object>>();
listIterator.add(listIntegers.iterator());
listIterator.add(listTwo.iterator());
listIterator.add(i3.iterator());
InterleaveIterator<Object> interleaveIterator = new InterleaveIterator<Object>(listIterator);
while (interleaveIterator.hasNext()){
Object object = interleaveIterator.next();
System.out.println(object);
}
}
@Override
public boolean hasNext() {
boolean hasNext = false;
if (columns < totalListsOfIterator ){
iterator = listIterator.get(columns++);
if ( iterator.hasNext() ){
next = iterator.next();
hasNext = true;
}else{
while ( columns < totalListsOfIterator ){
iterator = listIterator.get(columns++);
if ( iterator.hasNext() ){
next = iterator.next();
hasNext = true;
break;
}
}
}
}
if (columns == totalListsOfIterator){
columns = 0;
}
return hasNext;
}
@Override
public E next() {
iterator.remove();
return next;
}
@Override
public void remove() {
iterator.remove();
}
}
package test;
public class GoogleLexSubString {
public static void main(String[] args) {
String stringOne = "dztwbcdezfoptjklcd";
lexicography (stringOne);
}
public static void lexicography (String stringOne){
StringBuilder builder =new StringBuilder ();
String maxLexicography = new String();
String auxLexicography = new String();
boolean agregarAux=false;
int iterations=0, iterationsplusOne = 1;
int length = stringOne.length();
while (iterations<length-1 ){
char charStrOne = stringOne.charAt(iterations);
char charStrTwo = stringOne.charAt((iterationsplusOne));
if (charStrTwo < charStrOne){
if (auxLexicography.isEmpty()){
agregarAux = true;
maxLexicography = maxLexicography.concat(String.valueOf(charStrOne));
}else{
auxLexicography= auxLexicography.concat(String.valueOf(charStrOne));
if (auxLexicography.length()>maxLexicography.length()){
maxLexicography = new String( auxLexicography);
}
auxLexicography = new String();
}
builder.append(charStrOne);
builder = new StringBuilder ();
}else{
if (agregarAux){
auxLexicography= auxLexicography.concat(String.valueOf(charStrOne));
}else{
maxLexicography = maxLexicography.concat(String.valueOf(charStrOne));
}
builder.append(charStrOne);
}
if (iterationsplusOne == length-1){
builder.append(charStrTwo);
if (auxLexicography.length()>maxLexicography.length()){
maxLexicography = new String( auxLexicography);
}
}
iterations ++;
iterationsplusOne++;
}
System.out.println(maxLexicography);
}
}
I think that it works.
{
{
{
package test;
public class GoogleLexicography {
public static void main(String[] args) {
String stringOne = "mercurio", stringTwo = "merced";
boolean change =lexicography (stringOne, stringTwo);
if (change){
String aux = stringOne;
stringOne = new String( stringTwo);
stringTwo = new String( aux);
//System.out.println("stringOne "+stringOne);
}
//System.out.println(stringOne);
//System.out.println(stringTwo);
}
public static boolean lexicography (String stringOne, String stringTwo){
boolean change = false;
boolean wasDigraph = false;
int iterations=0;
int length = stringOne.length()> stringTwo.length() ? stringOne.length() : stringTwo.length();
while (iterations>length || !change){
if (wasDigraph){
wasDigraph = false;
}else{
char charStrOne = stringOne.charAt(iterations);
char charStrTwo = stringTwo.charAt(iterations);
if (charStrOne+1>length){
wasDigraph = true;
}
if (charStrTwo < charStrOne){
change = true;
}
}
iterations ++;
}
return change;
}
}
}
}
}
RepJesseDavis, Animator at 8x8
Hey I am Jack from us. I am working as a professor in MIT university.i Love my profession and ...
Repshivanojasy, Apple Phone Number available 24/7 for our Customers at A9
Dedicated worker with a following of regular customers and an understanding of sales and marketing.During my time away from ...
Repannadwilliams31, Applications Developer at National Instruments
I am Anthony, Human Resources specialist with a decade of successful experience in hiring and employee management.I am a ...
Repmarkhmitchell6, Analyst at ASAPInfosystemsPvtLtd
At first, tattooing was a hobby kind of thing for me. I didn’t spend too much time in tattoo ...
RepPennyRMullins, xyz at Aspire Systems
I am a creative Interior Designer with 2+ years of experience building customized solutions for residential and commercial clients. Intuitively ...
RepJanetCKeel, Accountant at ABC TECH SUPPORT
Hey i am Janet i am from Us and i leave here from last 4 years .My job is truck ...
Repsharonpkarr, None at BT
Hi! My name is Mary. I am a writer for a variety of web and multi-platform applications.I am a ...
Repmarkhlee8, Research Scientist at Bank of America
I am a cooking Instructor in New York USA, I Have a degree from the prestigious Culinary Arts Institute of ...
Repmarthahiggs71, Intern at Achieve Internet
Hi, I am Martha from Toledo, OH. Working with Top NYC consulting engineers by helping them design controls projects. Have ...
RepGigiTaylor, abc at 8x8
Dedicated English Mandarin Chinese translator with years of experience working in professional and scientific communities.Voracious reader and participant in ...
RepHelenBMartin, Android Engineer at ABC TECH SUPPORT
I am an avid reader and a leader and participant in a community book club. My reading Kamakhya Mandir Tantrik ...
RepAayshaRosie, HTML Freshers at Abs india pvt. ltd.
Aaysha , a book editor with 4 years of experience with increasing readership and developing skilled writers. At the Daily Record ...
Replillymartin, Senior Software Development Engineer at Aristocrat Gaming
Hi everybody! I'm Lilly, a 22 year old girl from Us. Master of economic and financial evaluation of development ...
Reprommie93544, Field Sales at Citrix Online
Roomie , an experienced group fitness instructor with the drive and knowledge and enthusiasm to apply the correct fitness techniques to ...
Repggeraldinejrivera, Aghori Mahakal Tantrik at ABC TECH SUPPORT
I am a fashion model, talented in runway turns and photoshoot prep. I Have worked at two displaying organizations and ...
Repjuanajcox4, Python Developer at Axiom Sources
I have 2 years of experience in designing and implementing computer algorithms or models for creating, displaying, and processing various ...
RepJenniferSRoe, Android test engineer at Accolite software
I am Jennifer from Dublin. I am Photographer, I have experienced in all different kinds of photography -Strong aesthetic sense ...
Repvickiwgerber, Member Technical Staff at Boomerang Commerce
I am Vicki From San Antonio USA, I am working as an Interior decorator in Golden Joy company. I have ...
Repshanitajjana, +27655765355 SSD MONEY CLEANING CHEMICAL +27655765355 BLACK MONEY IN JOHANNESBURG, OMAN, SAUDI ARABIA, SUDAN, Somalia ,Zimbabwe Botswana at 247quickbookshelp
Hi I am Shanita from San Bernardino USA. I am working as a manager in flore company. I am outgoing ...
Repdalejohnson762, Accountant at ABC TECH SUPPORT
I have exceptionally skilled Journalists possessed dogged determination to find the new story and deliver it to the public. I ...
Repverarfurman, Problem Setter at Cerberus Capital
I am Vera from Bullard USA, I am working as a Violin repairer in a Handyman company. My interest in ...
Repdavisjerryh, Backend Developer at Abs india pvt. ltd.
For the last two years, I am Effectively managing the team’s performance, conducting regular performance reviews and appraisals, and ...
Repkristinedavila9, Android Engineer at ABC TECH SUPPORT
I am Kristine Davila Professor and director at Clinical Psychology. Having experience of 6 years in my career. I have ...
RepSamiyahKate, Java Experienced at Agilent Technologies
I am Samiyah, having 3 years of experience in assessing, diagnosing, screening, and preventing language, speech, and swallowing disorders. I ...
RepSharonSwann, AT&T Customer service email at A9
Bilingual, self-motivated Air Hostess with a proven record of providing excellent customer service and exceeding all corporate and personal expectations ...
Reprajanadeep17, Android Engineer at 247quickbookshelp
I am a Special education teacher who adapts general education lessons and teaches various subjects to students with mild to ...
Repjenniferdray9, Accountant at ABC TECH SUPPORT
Hi I am Jennifer D. Ray from san Diego.Currently i am working as a parts salesperson in Rite solution ...
RepJoseElkins, Animator at ASU
I am working as Human Resources Associates, and my duties are for obtaining, recording, and interpreting human resources information within ...
RepRuthOrvis, AT&T Customer service email at 8x8
Hey I am Ruth Working as a branch manager in a bank.I have worked here for the last 4 ...
RepPamPucker, HR Executive at Adap.tv
I am Pam from Birmingham USA, A Secretary serves as a trusted personal assistant . My interest in ice skating, and ...
Repannaharricks, Computer Scientist at ABC TECH SUPPORT
Hi, I am a Social worker to help people handle everyday life problems. I also assist people who have issues ...
Repethelsizer, SDET at ADP
I am Ethel , creative news writer with 5+ years of experience. Have great storytelling skills , wrote and delivered high quality ...
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 ...
Repmartinskrull, Analyst at A9
Hi everyone, I am from new york,USA. I currently work in the Affiliate Marketing industry. I love all things ...
Reppaulaamontalvo, AT&T Customer service email at AMD
I am working as Human Resources Associates, and my duties are for obtaining, recording, and interpreting human resources information within ...
Repsusanaminick, Research Scientist at CapitalIQ
I am Susan from Dallas, I am working as a Property manager in Kohl's Food Stores company. I love ...
Repcarlaapepin, Area Sales Manager at Atmel
Hello, I am Carla and I live in San Bernardino, USA. I am working as a bookkeeper in a library ...
Repmitadwilson, Scientific Officer at Cleartrip.com
Hello, I am Mita from Dayton, I am working as a Systems programmer in Evans company, I have Experience of ...
Replouisefbray, Integration Software Engineer at Ask.com
Hey! My name is Louise and I am a computer hardware retailer and wholesaler.I also provide services online. My ...
Repriyanahobett, Sales Development Representative at Capgemini
I am Riyana , driven market researcher with over years of experience at Awthentikz , analyzing information in order to construct profiles ...
Repkany7635, optician at AMMB
I am a detail oriented and knowledgeable optical assistant with 2 years of experience in an optometry office setting. Collect ...
Repseinarondal, Applications Developer at ABC TECH SUPPORT
I am Seina, a hardworking individual with many years of customer service experience seeking a position with a company utilizing ...
RepChloePerez, cashier at POS
Versatile cashier with exemplary cash register system skills and proven commitment to store cleanliness and safely. Learning new and knowledgeable ...
Reprubyperezj, Backend Developer at A9
My name is Ruby Perez and I live in Lyndonville and it would be my honor and privilege to be ...
Repritahmixon, Analyst at ADP
Hi, I am a physiotherapy to help people handle everyday problems. I also assist peoples who have issues caused by ...
Repellahrivas6, Android test engineer at 247quickbookshelp
I am working as an internist and I work in medical offices, clinics, and hospitals. An internist may work independently ...
Repkarinkwalton, Backend Developer at Broadsoft
I am working as a Support clerk in an MVP Sports company. I love traveling and exploring facts about technology ...
RepMaryCParker, Dev Lead at ADP
My name is Mary and I am from usa.I am a representative sales advertising agent of (Specific Appraisals)company ...
Repjd5636176, Area Sales Manager at Achieve Internet
I am currently in the tool and die maker in Titania to start my career. I work from engineering drawings ...
Repclairetsmith49, AT&T Customer service email at ADP
Hello, I am Claire and work as a Human resources and I am responsible for recruiting, screening, interviewing and how ...
Repjaksanjak17, Sports official at Avant Garde Appraisal Group
I am a Sports official in Avant Garde Appraisal Group . in a variety of sports and competition, responsible for enforcing ...
RepEmma Neales, Intern at Student
For a long time, he worked as a programmer, while simultaneously studying and receiving a diploma. At that time, I ...
RepCarol Morris, DIGITAL MARKETING at Sophos
My name is Carol, I'm looking to work in digital marketing. Before that, I had no experience in this ...
Repmarkemorgan007, Applications Developer at Big Fish
I am Mark From Fresno city in USA.I working as a tour guide and also help for make a ...
RepAakeshCruz, Accountant at Tinder
Exceptional knowledge of mathematical concepts, accounting and finance topics, tax code, and banking principles.Worked with clients and CFOs to ...
- israAzul June 23, 2016