Posts

Showing posts from April, 2018

KMP Algorithm

Image
KMP String Matching Algorithm What is the meaning of KMP? KMP  -  Knuth - Morris - Pratt  History of KMP string matching algorithm The algorithm was conceived inn 1970 by Donald Knuth and Vaughan Pratt and independently by James H. Morris. The three published it jointly in 1977. Before learn about KMP algorithm there are two things to learn,                      1. Prefix                       A string ω is a prefix of a string x, denoted w ⊏  x,                           if x =  ωy for some string y € Σ* and                            | ω | <= |x|                           e.g. ab ⊏ abcca             2. Suffix                     A string ω is a suffix of a string x, denoted ω⊐ x,                           if x = yω for some string y € Σ* and                           |ω| <= |x|                           e.g. cca ⊐ abcca Note: The empty string ε is both a suffix and a prefix of every string. Let's move to algorithm, KMP requi

IP ADDRESSING

Image
හැමෝටම ආයුබෝවන් යාලුවනේ.අද මම කතාකරන්න යන්නේ Networking වල තියෙන මූලිකම කොටසක් වන ​IP Addressing  පිළිබදවයි.මොකක්ද මේ IP Address  එකක් කියන්නේ, පරිගණක ජාලයක තියෙන සැම පරිගණකයකටම යම් විශේෂ වූ ලිපිනයක් තියෙනවා.මෙන්න මේ Address එකට තමයි IP Address එකක් කියලා කියන්නේ. මම තවත් සරලව කියන්නම්කෝ.හිතන්නකෝ මේ ලෝකෙ තියෙන සැම ගෙදරකටම විශේෂිත වූ ලිපිනයන් තියෙනවනේ.අන්න ඒ වගේ තමයි Network එකක තියෙන සැම​​ Computers වලටම යම් විශේෂිත වූ ලිපිනයන්තියෙනවා.මෙන්න මේ ලිපිනයන් වලට තමයි IP Address කියල කියන්නේ. අපේ ලිපිනයක් ගත්තොත් ඒ ලිපිනය දිහා බැලුවහම අපිට කියන්න පුලුවන් ඒ ගෙදර අයිති වෙන්නේ මොන පලාතටද​  කියලා.අන්න ඒ වගේ තමයි Network  එකක​  IP Address යි Subnet mask එකයි දෙක එකතු කරලා අපිට කියන්න පුලුවන් ඒ Address එක අයිති වෙන්නේ මොන Subnet works එකටද කියලා. (Subnet mask , Subnetworks ගැන මම පහලින් පැහැදිලි කරන්නම්) මෙම IP Address ප්‍රධාන කොටස් 2 කි. 1.IPV4 (IP Version 4) 2.IPV6 (IP Version 6) 1. IPV4 (IP Version 4) IPV4  Address ක් Represent කිරීමට bit 32

Computer Networking Basic Component

Image
Hi, friends my previous post I explained  the Basic networking lesson.In this lesson I'll hope to discuss about What are the basic components to computer networking. In this post I'll explain; 1.Why Computer Networking? 2.Networking Basic Components   So first ,I have one question:Why Computer Networking.           Computer networks help users on the network to share the resources and in communication. Can you imagine  a world now without emails, online  newspapers , blogs, chat and the other services offered by the internet? I explain this one by one: File Sharing: Networking of computers helps the network users to share data files. Hardware Sharing: Users can share devices such as printers, scanners, CD-ROM drives, hard drives etc. Without computer networks, device sharing is not possible. User communication: Networks allow users to communicate using e-mail, newsgroups, and video conferencing etc. So I think yo

String Matching with Finite Automata

Image
👉How it works????? ♦Each character in pattern has a state. ♦ Each match sends the automaton into a new state ♦If all the characters in the pattern has been matched, the     automaton enters the accepting state.  ♦Otherwise, the automaton will return to a suitable state according to the current state and the input  character such that this returned state reflects the maximum advantage we can take from the       previous 👉 P reprocessing of pattern lets try example.... pattern= "ababc" lets make state transition table 1)Get the alphabet of pattern    alphabet of pattern  ={a,b,c} 2)Get the length of the pattern=5 lets draw the table.    1) 2) consider pattern lets fill "s0" column a      →      a     its match so value = 1 a     →     b     its doesn't  match so value = 0   a     →     c     its match so value = 0 lets fill "S1" column ab     →     aa its match  a

visitors