T.JOHN INSTITUTE OF TECHNOLOGY BANGALORE-83 DEPARTMENT OF TELECOMMUNICATION ENGINEERING.
CCN LAB MANUAL
Prepared By Mr.NARAY Mr.NAR AYANA ANA SWAMY.R Assoc.Prof, Dept of TCE TJIT, BANAL!RE
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
C!NTENTS I. CCN Programming Experiments in C/C++ (3 lab sessions of 3 hrs each) 1. Simlate bit/character stffing ! "e#stffing sing $%&C '. Simlate the shortest path algorithm 3. Encrption an" "ecrption of a gien message *. in" minimm spanning tree of a sbnet ,. Compte polnomial co"e chec-sm for CC#CCI II. CCN Experiments Experiments sing $ar"0are (1 lab session of 3 $rs each) 1. snchronos an" Snchronos Commnication sing S '3'/ 2ptical iber/ 0iste" 0iste" pair / *, '. 4sing for- fnction creates 52 processes an" commnicates bet0een them. 3. Commnicate bet0een 52 PCs6 sing simple soc-et fnction. III. %emonstrate the operations of rlogin an" telnet I7. I7. %emonstrate the operations of ftp6 mailbox.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
W"at #s DLL $Data L#%& Layer'
he %ata &in- &aer is the secon" laer in the 2SI mo"el6 aboe the Phsical &aer6 0hich ensres that the error free "ata is transferre" bet0een the a"8acent no"es in the net0or-. It brea-s the "atagrams passe" "o0n b aboe laers an" conerts them into frames rea" for transfer. his is calle" raming. It proi"es t0o main fnctionalities eliable "ata transfer serice bet0een t0o peer net0or- laers lo0 Control mechanism 0hich reglates the flo0 of frames sch that "ata congestion is not there at slo0 receiers "e to fast sen"ers.
W"at #s fra(#%)*
Since the phsical laer merel accepts an" transmits a stream of bits 0ithot an regar" to meaning or strctre6 it is p to the "ata lin- laer to create an" recogni9e frame bon"aries. his can be accomplishe" b attaching special bit patterns to the beginning an" en" of the frame. If these bit patterns can acci"entall occr in "ata6 special care mst be ta-en to ma-e sre these patterns are not incorrectl interprete" as frame "elimiters. he for framing metho"s that are 0i"el se" are +. Character cont . Starting an" en"ing characters6 0ith character stffing -. Starting an" en"ing flags6 0ith bit stffing . Phsical laer co"ing iolations +.
C"ar C"arac acte terr Co/% Co/%tt his metho" ses a fiel" in the hea"er to specif the nmber of characters in the frame. 5hen the "ata lin- laer at the "estination sees the character cont6 it -no0s ho0 man characters follo06 an" hence 0here the en" of the frame is. he "isa"antage is that if the cont is garble" b a transmission error6 the "estination 0ill lose snchroni9ation an" 0ill be nable to locate the start of the next frame. So6 this metho" is rarel se".
.
C"ar C"arac acte terr st/f st/ff# f#%) %) In the secon" metho"6 each frame starts 0ith the SCII character se:ence %&E S; an" en"s 0ith the se:ence %&E E;.(0here %&E is %ata &in- Escape6 S; is Start of e;t an" E; is En" of e;t.) his meth metho" o" oer oerco come mess the the "ra0 "ra0ba bacc-ss of the the char charac acte terr con contt meth metho" o".. If the the "est "estin inat atio ion n eer eer lose losess snchroni9ation6 it onl has to loo- for %&E S; an" %&E E; characters. If ho0eer6 binar "ata is being transmitte" then there exists a possibilit of the characters %&E S; an" %&E E; occrring in the "ata. Since this can interfere 0ith the framing6 a techni:e calle" character stffing is se".
So0/t#o%1 4se characterstuffing < 0ithin the frame6 replace eer occrrence of %&E 0ith the t0o#character se:ence %&E %&E. he receier reerses the processes6 replacing eer occrrence of %&E %&E 0ith a single %&Ebefore this "ata is gien to the net0or- laer. laer.
E2a(p0e1 If the frame containe" == > %&E % E %&E??6 the characters transmitte" oer the channel 0ol"
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
D#sad3a%ta)e1 character is the smallest nit that can be operate" on< not all architectres are bte oriente" an" this is a ma8or hr"le in transmitting arbitrar si9e" characters.
-.
B#t st st/ff#%) he thir" metho" allo0s "ata frames to contain an arbitrar nmber of bits an" allo0s character co"es 0ith an arbitrar nmber of bits per character. >it stffing is se" for arios prposes6 sch as a.
4or 5r#%)#%) 5r#%)#%) 5#t strea( strea(ss t"at do %ot %ecessar# %ecessar#0y 0y "a3e t"e sa(e sa(e or rat#o%a0 rat#o%a00y 0y re0ated re0ated 5#t rates rates /p to a co(( co((o% o% rate rate6 or to fill fill bff bffer erss or fram frames es.. he he loca locati tion on of the the stf stffi fing ng bits bits is commnicate" to the receiing en" of the "ata lin-6 0here these extra bits are remoe" to retrn the bit streams to their original bit rates or form. >it stffing ma be se" to snchroni9e seeral channels before mltiplexing or to rate#match t0o single channels to each other.
pplications incl"e Plesiochronos %igital $ierarch an" Snchronos %igital $ierarch. $ierarch. 5.
A%ot"e A%ot"err /se of of 5#t st/ff#% st/ff#%) ) #s for r/% r/% 0e%)t" 0e%)t" 0#(#t 0#(#ted ed cod#%) cod#%)@ to limit the nmber of consectie bits of the same ale in the "ata to be transmitte". bit of the opposite ale is inserte" after the maximm allo0e" nmber of consectie bits. Since this is a general rle the receier "oesn?t nee" extra information abot the location of the stffing bits in or"er to "o the "estffing. his is "one to create a""itional signal transitions to ensre reliable transmission or to escape special resere" co"e 0or"s sch as frame snc se:ences 0hen the "ata happens to contain them.
pplications incl"e Controller rea Net0or-6 $%&C6 an" 4niersal Serial >s. >it stffing "oes not ensre that the paloa" is intact (i.e. not corrpte" b transmission errors)< it is merel a 0a of attempting to ensre that the transmission starts an" en"s at the correct places. Error "etection an" correction techni:es are se" to chec- the frame for corrption after its "elier an"6 if necessar6 necessar6 the frame 0ill be resent. 6ero75#t #%sert#o%
Aero#bit insertion is a particlar tpe of bit stffing (in the latter sense) se" in some "ata transmission protocols. It 0as poplari9e" b I>B?s S%&C (later rename" $%&C)6 to ensre that the rame Snc Se:ence (SS) neer appears in a "ata frame. n SS is the metho" of frame snchroni9ation se" b $%&C to in"icate the beginning an"/or en" of a frame. he name relates to the insertion of onl bits. No 1 bits are inserte" inserte" to limit se:ences of bits. he bit se:ence D111111D containing six a"8acent 1 bits is commonl se" as a Dlag bteD or SS. o ensre that this pattern neer appears in normal "ata6 a bit is stffe" after eer fie 1 bits in the "ata. his tpicall a""s 1 stffe" bit to eer 3' ran"om paloa" bits6 on aerage. Note that this stffe" bit is a""e" een if the follo0ing "ata bit is 6 0hich col" not be mista-en for a snc se:ence6 so that the receier can nambigosl "istingish stffe" bits from normal bits. 5hen the receier sees fie consectie 1s in the incoming "ata stream6 follo0e" b a 9ero bit6 it atomaticall "estffs the bit. he bon"ar bet0een t0o frames can be "etermine" b locating the flag pattern. .
P"ys P"ys#c #ca0 a0 0aye 0ayerr cod# cod#%) %) 3#o0 3#o0at at#o #o%s %s
he final framing metho" is phsical laer co"ing iolations an" is applicable to net0or-s in 0hich the enco"ing on the phsical me"im contains some re"n"anc. In sch cases normall6 a 1 bit is a high#lo0 pair an" a bit is i s a lo0#high pair. he combinations of lo0#lo0 an" high#high 0hich are not se" for "ata ma be se" for mar-ing frame bon"aries.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
//************************************** // Name: bit stuffing // Description: performs performs bit stuffing/destuffing stuffing/destuffing on an input input data stream //************************************** #include #include #define MAX!" $%% int main&' ( char *p)*+ char temp+ char in,MAX!"-+ char stuff,MAX!"-+ char destuff,MAX!"-+ int count%+ printf&enter the input character string &%0s 1 $0s onl2':3n'+ scanf&4s)in'+ pin+ stuff+ 5hile&*p673%7' ( if&*p7%7' ( **p+ 88+ p88+ 9 else ( 5hile&*p7$7 11 count6' ( count88+ **p+ 88+ p88+ 9
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
count%+ 9 9 *73%7+ printf&3nthe stuffed character string is'+ printf&3n4s)stuff'+ pstuff+ destuff+
5hile&*p673%7' ( if&*p7%7' ( **p+ 88+ p88+ 9 else ( 5hile&*p7$7 11 count6' ( count88+ **p+ 88+ p88+ 9 if&count' ( p88+ 9 count%+ 9 9 *73%7+ printf&3nthe destuffed character string is'+ printf&3n4s3n)destuff'+ return %+ 9
enter the input character string &%0s 1 $0s onl2':
$$$$$ the stuffed character string is
$$$$%$ the destuffed character string is
$$$$$
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
//************************************** // Name: character character stuffing // Description:to perform perform character character stuffing on input input data stream&net5or;ing stream&net5or;ing // lin; la2er la2er actiit2' //**************************************
#include #include #define MAX!" $%% int main&' ( char in,MAX!"-)stuff,MAX!"-)d in,MAX!"-)stuff,MAX!"-)destuff,MAX!"-+ estuff,MAX!"-+ char *p)*+ int i+ printf&enter the string to be character stuffed3n'+ scanf&4s)in'+ pin+ stuff+ 5hile&*p673%7' ( if&*p7d7' ( **p+ p88+ 88+ if&*p7l7' ( **p+ p88+
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
9 *73%7+ printf&3nthe stuffed string is'+ printf&3n4s)stuff'+
pstuff+ destuff+
5hile&*p673%7' ( if&*p7d7' ( **p+ p88+ 88+ if&*p7l7' ( **p+ p88+ 88+ if&*p7e7' ( **p+ p88+ 88+ for&i$+i<=+i88' p88+ 9 9 9 else ( **p+ 88+ p88+ 9 9 *73%7+ printf&3nthe destuffed string is'+ printf&3n4s3n)destuff'+ return %+ 9
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Data Encryt!"n an# D$cryt!"n plaintext ) into something that appears to be ran"om an" Encrption is the process of translating plain text "ata ( plaintext meaningless (cipher text). %ecrption is the process of conerting cipher text bac- to plaintext.
o encrpt encrpt more than a small amont of "ata6 symmetric encryption is se". symmetric key is se" "ring both the encrption an" "ecrption processes. o "ecrpt a particlar piece of cipher text6 the -e that 0as se" to encrpt the "ata mst be se". he goal of eer encrption algorithm is to ma-e it as "ifficlt as possible to "ecrpt the generate" cipher text 0ithot sing the -e. If a reall goo" encrption algorithm is se"6 there is no techni:e significantl better than metho"icall tring eer possible -e. or sch an algorithm6 the longer the -e6 the more "ifficlt it is to "ecrpt a piece of cipher text 0ithot possessing the -e.
//************************************** // Name: ncr2ption and Decr2ption Decr2ption of string string //**************************************
#include
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
str[i] str[i] " key; $ $ int %ain() int %ain() { char str[] char str[] &s%urff'kdo& ; printf(&*ass+rod printf( &*ass+rod s-n& s-n&,str); ,str); encrypt(str,!/'0'); printf(&1ncrypted printf( &1ncrypted value s-n& ,str); decrypt(str,!/'0'); printf(&ecrypted printf( &ecrypted value s-n& ,str); return !; return !; $
S"ortest pat" pro50e( In graph In graph theor6 the theor6 the s"ortest pat" pro50e( is the problem of fin"ing a path a path bet0een bet0een t0o ertices t0o ertices (or no"es) in a graph sch graph sch that the sm of the 0eights of 0eights of its constitent e"ges is minimi9e". he most important algorithms for soling this problem are@ •
D#8&stra9s a0)or#t"( soles the single#sorce shortest path problems.
•
>ellmanor" algorithm soles algorithm soles the single#sorce problem if e"ge 0eights ma be negatie.
•
F search algorithm soles algorithm soles for single pair shortest path sing heristics to tr to spee" p t he search.
•
lo"5arshall algorithm soles algorithm soles all pairs shortest paths.
•
ohnson?s algorithm soles algorithm soles all pairs shortest paths6 an" ma be faster than lo"5arshall lo"5arshall on sparse graphs. graphs.
""itional algorithms an" associate" ealations ma be fon" in Cher-ass- et al. al.G1H Def#%#t#o%
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
he he s#%)0e7so/rce s"ortest pat" pro50e(6 in 0hich 0e hae to fin" shortest paths from a sorce ertex v to all other ertices in the graph. s#%)0e7dest#%at# t#%at#o% o% s"ortest s"ortest pat" pro50e( pro50e(6 in 0hich 0e hae to fin" shortest paths from all he s#%)0e7des ertices in the "irecte" graph to a single "estination ertex v. his can be re"ce" to the single#sorce shortest path problem b reersing the arcs in the "irecte" graph. he a007pa#rs s"ortest pat" pro50e(6 in 0hich 0e hae to fin" shortest paths bet0een eer pair of ertices v6 v' in in the graph. hese generali9ations hae significantl more efficient algorithms than the simplistic approach of rnning a single#pair shortest path algorithm on all releant pairs of ertices. •
•
•
D!%&'tra(' A)*"r!t+, Dijkstra's algorithm is a greedy algorithm that solves the shortest path problem for a directed graph G.Dijkstra's algorithm solves the single-source shortest-path problem when all edges have non-negative weights.
Dijkstra's Algorithm 234567'(8, +, s) 9 2262':21528:15=701(8, s) 5 ?@ A B ?C[8] D+hile B E@ F do u ? 1G67'06H2(B) I 5 ? 5 {u$ J for each verte v 'dK[u] L do71:'G(u, v, +)
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
!rocedure for Dijkstra's Algorithm
St$ "onsider A as source verte #o. of #odes
A
$
"
D
E
Distance
%
&%
3
A
A
D
E
Distance (rom
St$ #ow consider verte " #o. of #odes
A
$
"
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Distance (rom
"
A
"
E
St$0 #ow consider verte $ #o. of #odes
A
$
"
D
E
Distance
%
1
*
+
,
"
A
$
"
Distance (rom
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
A
B
C
D
E
%
%
&%
*
)
*
&& &&
,
E
&
,
$
2
A "
D
&
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
// Name: shortest path path algorithm //**************************************
#include #include #include #include void %ain() void %ain() { int int path[F][F],i,K,%in,a[F][F],p,st9,edF,stp,edp,t[F],inde; clrscr(); printf(&enter printf(&enter the cost %atri-n& ); for(i9;i<F;i"") for (i9;i<F;i"") for(K9;K<F;K"") for (K9;K<F;K"") scanf(&d& scanf( &d&,Ma[i][K]); ,Ma[i][K]); printf(&enter printf(&enter nu%Ner of paths-n& ); scanf(&d& scanf( &d&,Mp); ,Mp); printf(&enter printf(&enter possiNle paths-n& ); for(i9;i<p;i"") for (i9;i<p;i"") for(K9;K<F;K"") for (K9;K<F;K"") scanf(&d& scanf( &d&,Mpath[i][K]); ,Mpath[i][K]);
for(i9;i<p;i"") for (i9;i<p;i"") { t[i]!; stpst; for(K9;K<F;K"") for(K9;K<F;K"") { edppath[i][K"9];
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
if(path[inde][i]ed) if(path[inde][i]ed) Nreak; Nreak ; $ getch(); $
OP=6*=6Q enter the cost %atri Q ! 9 D ! ! ! ! A ! ! ! A ! ! ! ! ! F ! ! ! ! ! enter nu%Ner of paths Q D enter possiNle paths Q 9 D F ! 9 F ! ! 9 D F ! ! 9 A D F ! %ini%u% cost Q D %ini%u% cost path Q 9R>R>FPO
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Pr#(9s A0)or#t"( A0)or#t"( Prim?s algorithm is a gree" algorithm that fin"s a minimm spanning tree for a connecte" 0eighte" n"irecte" graph. It fin"s a sbset of the e"ges that forms a tree that i ncl"es eer ertex6 0here the total 0eight of all the e"ges in the tree is minimi9e". his algorithm is "irectl base" on the BS (minimm spanning tree) propert.
E2a(p0e
Simple 5eighte" raph
Binimm Cost Spanning ree
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Proced/re for f#%d#%) M#%#(/( Spa%%#%) Tree Tree Step+
No. of No"es %istance %istance rom
1 3
' +
3
* K
, K
Step
No. of No"es %istance %istance rom
Step-
1
'
3 , '
* '
, * '
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
C IMPLEMETATI!N of pr#(9s A0)or#t"( Vincl"eTst"io.hW Vincl"eTconio.hW inta6b666n6i686neU1< int isite"G1HUXY6min6mincostU6costG1H isite"G1HUXY6min6mincostU6costG1HG1H< G1H< oi" main() X clrscr()< printf(DZnEnter the nmber nmber of no"es@D)< scanf(D["D6!n)< printf(DZnEnter the a"8acenc a"8acenc matrix@ZnD)< for(iU1
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
his is a C Program for implementing CC (Cclic e"n"anc Chec- Co"e) /include 0stdio.h1 /include 0conio.h1 /include 0string.h1 voidmain23 4 inti5j5keylen5msglen6 charinput7&%%85key7*%85temp7*%859uot7&%%85rem7*%85key&7*%86 clrscr236 printf2:Enter Data; :36 gets2input36 printf2:Enter >3
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
for2i=%6i0keylen-&6i>>3 printf2:Bc:5rem7i836 printf2:@n(inal printf2:@n(inal data is; :36 for2i=%6i0msglen6i>>3 printf2:Bc:5input7i836 for2i=%6i0keylen-&6i>>3 printf2:Bc:5rem7i836 getch236 ?
Ott4