Skip to content

Instantly share code, notes, and snippets.

@czxttkl
czxttkl / homework 1b
Created August 31, 2013 03:36
Two linked lists (simple link, not double link) heads are given: headA, and headB; it is also given that the two lists intersect, thus after the intersection they have the same elements to the end. Find the first common element (without modifying the lists elements or using additional datastructures)
package io.github.czxttkl.homework;
import java.util.LinkedList;
public class HomeWork1b {
private static <T> void findFirstElement(LinkedList<T> linkA,
LinkedList<T> linkB) {
int offsetA = 0;
public class HomeWork1b {
private static <T> void findFirstElement(LinkedList<T> linkA,
LinkedList<T> linkB) {
int offsetA = 0;
int offsetB = 0;
if (linkB.size() > linkA.size())
offsetB = linkB.size() - linkA.size();
@czxttkl
czxttkl / test
Created May 14, 2013 14:37
a javacv test snippethow to see total line of a git project
@Override
public void actionPerformed(ActionEvent arg0 @Override
public void actionPerformed(ActionEvent arg0