Posts

InterpolationSearch

Image
Interpolation search is an improved variant of binary search. This search algorithm works on the probing position of the required value. For this algorithm to work properly, the data collection should be in a sorted form and equally distributed. Binary search has a huge advantage of time complexity over linear search. Linear search has worst-case complexity of Ο(n) whereas binary search has Ο(log n). There are cases where the location of target data may be known in advance. For example, in case of a telephone directory, if we want to search the telephone number of Morphius. Here, linear search and even binary search will seem slow as we can directly jump to memory space where the names start from 'M' are stored. Positioning in Binary Search In binary search, if the desired data is not found then the rest of the list is divided in two parts, lower and higher. The search is carried out in either of them. Even when the data is sorted, binary search does ...

Binary Search

Image

ce dengor hok ning skali

Image

sorting

Image

Pengenalan kepada "Link List"

Image
Video di bawah menerangkan mengenai konsep array dan linklist dari aspek memori komputer.Selamat menonton.

Koding HTML untuk masukkan checkbox

Berikut adalah contoh koding html bagi memasukkan checkbox ke dalam laman sesawang anda. <!DOCTYPE html> <html> <body> <form action=""> <input type="checkbox" name="vehicle" value="Bike">I have a bike<br> <input type="checkbox" name="vehicle" value="Car">I have a car </form> </body> </html> sekian..terima kasih sumber w3school

Java Regex

Java Regex The  Java Regex  or Regular Expression is an API to  define pattern for searching or manipulating strings . It is widely used to define constraint on strings such as password and email validation. After learning java regex tutorial, you will be able to test your own regular expressions by the Java Regex Tester Tool. Java Regex API provides 1 interface and 3 classes in  java.util.regex  package. Contoh: import java.util.regex.*; public class RegexExample1{ public static void main(String args[]){ //1st way Pattern p = Pattern.compile("peng.*");//. represents single character Matcher m = p.matcher("penggaris"); boolean b = m.matches(); //2nd way boolean b2=Pattern.compile(".s").matcher("as").matches(); //3rd way boolean b3 = Pattern.matches(".s", "as"); System.out.println(b+" "+b2+" "+b3); }} Nota dan sumber daripada: http://www.javatpoint.com/java-regex http://ww...