Demo entry 6762369

Mohsin Khan

   

Submitted by anonymous on Oct 14, 2018 at 14:55
Language: Java. Code size: 338 Bytes.

public static void main(String[] args) {
		int [] elements = new int[] {123, 34, 45, 634, 5643, 121};
		LinearSearch linearSearch = new LinearSearch(elements);
		int index = linearSearch.search(121);
		if(index > 0) {
			System.out.println("Found At " + index + " position");
		} else {
			System.err.println("Not Found");
		}
	}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).