This document discusses graph representation and traversal techniques. It begins by defining graph terminology like vertices, edges, adjacency, and paths. It then covers different ways to represent graphs, including adjacency lists and matrices. It describes the pros and cons of each representation. The document also explains depth-first search and breadth-first search traversal algorithms in detail, including pseudocode. It analyzes the time complexity of these algorithms. Finally, it briefly discusses other graph topics like strongly connected components and biconnected components.
Depth-first search (DFS) is an algorithm for traversing or searching tree or graph data structures. The algorithm starts at the root node (selecting some arbitrary node as the root node in the case of a graph) and explores as far as possible along each branch before backtracking
BREADTH FIRST SEARCH (bfs)
Inventor of bfs
Example of bfs
Algorithm of bfs
Complexity
Time Complexity
Space Complexity
Queue in bfs
bfs optimal
Container of bfs
Completeness of bfs
Shallowest node
Uninformed search technique
Application of bfs
Conclusion
Thank you for visiting.......
BFS is the most commonly used approach. BFS is a traversing algorithm where you should start traversing from a selected node (source or starting node) and traverse the graph layerwise thus exploring the neighbor nodes (nodes which are directly connected to the source node.
The Computer Science solves a lot of daily problems in our lifes, one of them is search problems. These problems sometimes are so hard to find a good solution because is necessary study hard to comprehend the problem, modeling it and after this propose a solution. In this homework, my goal is define and explain the differ- ences between the algorithms DFS - Depth-First Search and Backtrancking. Firstly, I will introduce these algorithms in the section 2 and 3 to DFS and Backtracking respectively. In the section 4 I will show the differences between them. Finally, the conclusion in the section 5.
Depth-first search (DFS) is an algorithm for traversing or searching tree or graph data structures. The algorithm starts at the root node (selecting some arbitrary node as the root node in the case of a graph) and explores as far as possible along each branch before backtracking
BREADTH FIRST SEARCH (bfs)
Inventor of bfs
Example of bfs
Algorithm of bfs
Complexity
Time Complexity
Space Complexity
Queue in bfs
bfs optimal
Container of bfs
Completeness of bfs
Shallowest node
Uninformed search technique
Application of bfs
Conclusion
Thank you for visiting.......
BFS is the most commonly used approach. BFS is a traversing algorithm where you should start traversing from a selected node (source or starting node) and traverse the graph layerwise thus exploring the neighbor nodes (nodes which are directly connected to the source node.
The Computer Science solves a lot of daily problems in our lifes, one of them is search problems. These problems sometimes are so hard to find a good solution because is necessary study hard to comprehend the problem, modeling it and after this propose a solution. In this homework, my goal is define and explain the differ- ences between the algorithms DFS - Depth-First Search and Backtrancking. Firstly, I will introduce these algorithms in the section 2 and 3 to DFS and Backtracking respectively. In the section 4 I will show the differences between them. Finally, the conclusion in the section 5.
An overview of the most simple algorithms used in data structures for path finding. Dijkstra, Breadth First Search, Depth First Search, Best First Search and A-star
Naturally feel free to copy for assignments and all
graphin-c1.png
graphin-c1.txt
1: 2
2: 3 8
3: 4
4: 5
5: 3
6: 7
7: 3 6 8
8: 1 9
9: 1
graphin-c2.jpg
graphin-c2.txt
1: 2 9
2: 3 8
3: 4
4: 5 9
5: 3
6: 7
7: 3 6 8
8: 1
9:
graphin-DAG.png
graphin-DAG.txt
1: 2
2: 3 8
3: 4
4: 5
5: 9
6: 4 7
7: 3 8
8: 9
9:
CS 340 Programming Assignment III:
Topological Sort
Description: You are to implement the Depth-First Search (DFS) based algorithm for (i)
testing whether or not the input directed graph G is acyclic (a DAG), and (ii) if G is a DAG,
topologically sorting the vertices of G and outputting the topologically sorted order.
I/O Specifications: You will prompt the user from the console to select an input graph
filename, including the sample file graphin.txt as an option. The graph input files must be of
the following adjacency list representation where each xij is the j'th neighbor of vertex i (vertex
labels are 1 through n):
1: x11 x12 x13 ...
2: x21 x22 x23 ...
.
.
n: xn1 xn2 xn3 ...
Your output will be to the console. You will first output whether or not the graph is acyclic. If
the graph is NOT acyclic, then you will output the set of back edges you have detected during
DFS. Otherwise, if the graph is acyclic, then you will output the vertices in topologically
sorted order.
Algorithmic specifications:
Your algorithm must use DFS appropriately and run in O(E + V) time on any input graph. You will
need to keep track of edge types and finish times so that you can use DFS for detecting
cyclicity/acyclicity and topologically sorting if the graph is a DAG. You may implement your graph
class as you wish so long as your overall algorithm runs correctly and efficiently.
What to Turn in: You must turn in a single zipped file containing your source code, a Makefile
if your language must be compiled, appropriate input and output files, and a README file
indicating how to execute your program (especially if not written in C++ or Java). Refer to
proglag.pdf for further specifications.
This assignment is due by MIDNIGHT of Monday, February 19. Late submissions
carry a minus 40% per-day late penalty.
Sheet1Name:Possible:Score:Comments:10Graph structure with adjacency list representationDFS16Correct and O(V+E) time10Detecting cycles, is graph DAG?Topological Sort16Correctness of Topo-Sort algorithm and output18No problems in compilation and execution? Non-compiling projects receive max total 10 points, and code that compiles but crashes during execution receives max total 18 points.700Total
&"Helvetica,Regular"&12&K000000&P
Sheet2
&"Helvetica,Regular"&12&K000000&P
Sheet3
&"Helvetica,Regular"&12&K000000&P
DFS and topological sort
CS340
Depth first search
breadth
depth
Search "deeper" whenever possible
*example shows discovery times
Depth first search
Input: G = (V,E), directed or undirected.
No source vertex is given!
Output: 2 timestamps on each vertex:
v.d discovery time
v.f finishing time
These will be useful ...
Abstract: This PDSG workship introduces basic concepts on Tree and Graph Theory. It covers topics for level-first search (BFS), inorder, preorder and postorder depth first search (DFS), depth limited search (DLS), iterative depth search (IDS), as well as tri-coding to prevent revisiting nodes in a cyclic paths in a graph. Examples are given pictorially, pseudo code and in Python.
Level: Fundamental
Requirements: No prior programming knowledge is required.
Register Organization of 8086, Architecture, Signal Description of 8086, Physical Memory
Organization, General Bus Operation, I/O Addressing Capability, Special Processor Activities,
Minimum Mode 8086 System and Timings, Maximum Mode 8086 System and Timings.
Addressing Modes of 8086.
Machine Language Instruction Formats – Instruction Set of 8086-Data transfer
instructions,Arithmetic and Logic instructions,Branch instructions,Loop instructions,Processor
Control instructions,Flag Manipulation instructions,Shift and Rotate instructions,String
instructions, Assembler Directives and operators,Example Programs,Introduction to Stack,
STACK Structure of 8086, Interrupts and Interrupt Service Routines, Interrupt Cycle of 8086,
Non-Maskable and Maskable Interrupts, Interrupt Programming, MACROS.
Network Security: Authentication Applications, Electronic Mail Security, IP Security, Web
Security, System Security: Intruders, Malicious Software, Firewalls
Network Security: Authentication Applications, Electronic Mail Security, IP Security, Web
Security, System Security: Intruders, Malicious Software, Firewalls
Key Management, Diffie-Hellman Key Exchange, Elliptic Curve Arithmetic, Elliptic Curve
Cryptography, Message Authentication and Hash Functions, Hash and MAC Algorithms
Digital Signatures and Authentication Protocols
Key Management, Diffie-Hellman Key Exchange, Elliptic Curve Arithmetic, Elliptic Curve
Cryptography, Message Authentication and Hash Functions, Hash and MAC Algorithms
Digital Signatures and Authentication Protocols
Registers - Serial in serial out, Serial in Parallel out, Parallel in serial out, Parallel in Parallel
out registers, Bidirectional shift registers, universal shift registers.
Counters - Synchronous and asynchronous counters, UP/DOWN counters, Modulo-N
Counters, Cascaded counter, Programmable counter, Counters using shift registers, application
of counters.
Advanced Encryption Standard, Multiple Encryption and Triple DES, Block Cipher Modes of
operation, Stream Ciphers and RC4, Confidentiality using Symmetric Encryption, Introduction
to Number Theory: Prime Numbers, Fermat’s and Euler’s Theorems, Testing for Primality, The
Chinese Remainder Theorem, Discrete Logarithms, Public-Key Cryptography and RSA
Advanced Encryption Standard, Multiple Encryption and Triple DES, Block Cipher Modes of
operation, Stream Ciphers and RC4, Confidentiality using Symmetric Encryption, Introduction
to Number Theory: Prime Numbers, Fermat’s and Euler’s Theorems, Testing for Primality, The
Chinese Remainder Theorem, Discrete Logarithms, Public-Key Cryptography and RSA
Introduction: OSI Security Architecture, Security attacks, ,Security Services, Security
Mechanisms, Model for Network Security, Fundamentals of Abstract Algebra : Groups, Rings,
Fields, Modular Arithmetic, Euclidean Algorithm, Finite Fields of the form GF(p),Polynomial
Arithmetic, Finite Fields of the form GF(2n),Classical Encryption techniques, Block Ciphers and
Data Encryption Standard.
Introduction: OSI Security Architecture, Security attacks, ,Security Services, Security
Mechanisms, Model for Network Security, Fundamentals of Abstract Algebra : Groups, Rings,
Fields, Modular Arithmetic, Euclidean Algorithm, Finite Fields of the form GF(p),Polynomial
Arithmetic, Finite Fields of the form GF(2n),Classical Encryption techniques, Block Ciphers and
Data Encryption Standard.
Meet Dinah Mattingly – Larry Bird’s Partner in Life and Loveget joys
Get an intimate look at Dinah Mattingly’s life alongside NBA icon Larry Bird. From their humble beginnings to their life today, discover the love and partnership that have defined their relationship.
Experience the thrill of Progressive Puzzle Adventures, like Scavenger Hunt Games and Escape Room Activities combined Solve Treasure Hunt Puzzles online.
As a film director, I have always been awestruck by the magic of animation. Animation, a medium once considered solely for the amusement of children, has undergone a significant transformation over the years. Its evolution from a rudimentary form of entertainment to a sophisticated form of storytelling has stirred my creativity and expanded my vision, offering limitless possibilities in the realm of cinematic storytelling.
Maximizing Your Streaming Experience with XCIPTV- Tips for 2024.pdfXtreame HDTV
In today’s digital age, streaming services have become an integral part of our entertainment lives. Among the myriad of options available, XCIPTV stands out as a premier choice for those seeking seamless, high-quality streaming. This comprehensive guide will delve into the features, benefits, and user experience of XCIPTV, illustrating why it is a top contender in the IPTV industry.
Meet Crazyjamjam - A TikTok Sensation | Blog EternalBlog Eternal
Crazyjamjam, the TikTok star everyone's talking about! Uncover her secrets to success, viral trends, and more in this exclusive feature on Blog Eternal.
Source: https://blogeternal.com/celebrity/crazyjamjam-leaks/
Young Tom Selleck: A Journey Through His Early Years and Rise to Stardomgreendigital
Introduction
When one thinks of Hollywood legends, Tom Selleck is a name that comes to mind. Known for his charming smile, rugged good looks. and the iconic mustache that has become synonymous with his persona. Tom Selleck has had a prolific career spanning decades. But, the journey of young Tom Selleck, from his early years to becoming a household name. is a story filled with determination, talent, and a touch of luck. This article delves into young Tom Selleck's life, background, early struggles. and pivotal moments that led to his rise in Hollywood.
Follow us on: Pinterest
Early Life and Background
Family Roots and Childhood
Thomas William Selleck was born in Detroit, Michigan, on January 29, 1945. He was the second of four children in a close-knit family. His father, Robert Dean Selleck, was a real estate investor and executive. while his mother, Martha Selleck, was a homemaker. The Selleck family relocated to Sherman Oaks, California. when Tom was a child, setting the stage for his future in the entertainment industry.
Education and Early Interests
Growing up, young Tom Selleck was an active and athletic child. He attended Grant High School in Van Nuys, California. where he excelled in sports, particularly basketball. His tall and athletic build made him a standout player, and he earned a basketball scholarship to the University of Southern California (U.S.C.). While at U.S.C., Selleck studied business administration. but his interests shifted toward acting.
Discovery of Acting Passion
Tom Selleck's journey into acting was serendipitous. During his time at U.S.C., a drama coach encouraged him to try acting. This nudge led him to join the Hills Playhouse, where he began honing his craft. Transitioning from an aspiring athlete to an actor took time. but young Tom Selleck became drawn to the performance world.
Early Career Struggles
Breaking Into the Industry
The path to stardom was a challenging one for young Tom Selleck. Like many aspiring actors, he faced many rejections and struggled to find steady work. A series of minor roles and guest appearances on television shows marked his early career. In 1965, he debuted on the syndicated show "The Dating Game." which gave him some exposure but did not lead to immediate success.
The Commercial Breakthrough
During the late 1960s and early 1970s, Selleck began appearing in television commercials. His rugged good looks and charismatic presence made him a popular brand choice. He starred in advertisements for Pepsi-Cola, Revlon, and Close-Up toothpaste. These commercials provided financial stability and helped him gain visibility in the industry.
Struggling Actor in Hollywood
Despite his success in commercials. breaking into large acting roles remained a challenge for young Tom Selleck. He auditioned and took on small parts in T.V. shows and movies. Some of his early television appearances included roles in popular series like Lancer, The F.B.I., and Bracken's World. But, it would take a
In the vast landscape of cinema, stories have been told, retold, and reimagined in countless ways. At the heart of this narrative evolution lies the concept of a "remake". A successful remake allows us to revisit cherished tales through a fresh lens, often reflecting a different era's perspective or harnessing the power of advanced technology. Yet, the question remains, what makes a remake successful? Today, we will delve deeper into this subject, identifying the key ingredients that contribute to the success of a remake.
From the Editor's Desk: 115th Father's day Celebration - When we see Father's day in Hindu context, Nanda Baba is the most vivid figure which comes to the mind. Nanda Baba who was the foster father of Lord Krishna is known to provide love, care and affection to Lord Krishna and Balarama along with his wife Yashoda; Letter’s to the Editor: Mother's Day - Mother is a precious life for their children. Mother is life breath for her children. Mother's lap is the world happiness whose debt can never be paid.
Panchayat Season 3 - Official Trailer.pdfSuleman Rana
The dearest series "Panchayat" is set to make a victorious return with its third season, and the fervor is discernible. The authority trailer, delivered on May 28, guarantees one more enamoring venture through the country heartland of India.
Jitendra Kumar keeps on sparkling as Abhishek Tripathi, the city-reared engineer who ends up functioning as the secretary of the Panchayat office in the curious town of Phulera. His nuanced depiction of a young fellow exploring the difficulties of country life while endeavoring to adjust to his new environmental factors has earned far and wide recognition.
Neena Gupta and Raghubir Yadav return as Manju Devi and Brij Bhushan Dubey, separately. Their dynamic science and immaculate acting rejuvenate the hardships of town administration. Gupta's depiction of the town Pradhan with an ever-evolving outlook, matched with Yadav's carefully prepared exhibition, adds profundity and credibility to the story.
New Difficulties and Experiences
The trailer indicates new difficulties anticipating the characters, as Abhishek keeps on wrestling with his part in the town and his yearnings for a superior future. The series has reliably offset humor with social editorial, and Season 3 looks ready to dig much more profound into the intricacies of rustic organization and self-awareness.
Watchers can hope to see a greater amount of the enchanting and particular residents who have become fan top picks. Their connections and the one of a kind cut of-life situations give a reviving and interesting portrayal of provincial India, featuring the two its appeal and its difficulties.
A Mix of Humor and Heart
One of the signs of "Panchayat" is its capacity to mix humor with sincere narrating. The trailer features minutes that guarantee to convey giggles, as well as scenes that pull at the heartstrings. This equilibrium has been a critical calculate the show's prosperity, resounding with crowds across different socioeconomics.
Creation Greatness
The creation quality remaining parts first rate, with the beautiful setting of Phulera town filling in as a scenery that upgrades the narrating. The meticulousness in portraying provincial life, joined with sharp composition and solid exhibitions, guarantees that "Panchayat" keeps on hanging out in the packed web series scene.
Expectation and Delivery
As the delivery date draws near, expectation for "Panchayat" Season 3 is at a record-breaking high. The authority trailer has previously created critical buzz, with fans enthusiastically anticipating the continuation of Abhishek Tripathi's excursion and the new undertakings that lie ahead in Phulera.
All in all, the authority trailer for "Panchayat" Season 3 recommends that watchers are in for another drawing in and engaging ride. Yet again with its charming characters, convincing story, and ideal mix of humor and show, the new season is set to enamor crowds. Write in your schedules and prepare to get back to the endearing universe of "Panchayat."
Tom Selleck Net Worth: A Comprehensive Analysisgreendigital
Over several decades, Tom Selleck, a name synonymous with charisma. From his iconic role as Thomas Magnum in the television series "Magnum, P.I." to his enduring presence in "Blue Bloods," Selleck has captivated audiences with his versatility and charm. As a result, "Tom Selleck net worth" has become a topic of great interest among fans. and financial enthusiasts alike. This article delves deep into Tom Selleck's wealth, exploring his career, assets, endorsements. and business ventures that contribute to his impressive economic standing.
Follow us on: Pinterest
Early Life and Career Beginnings
The Foundation of Tom Selleck's Wealth
Born on January 29, 1945, in Detroit, Michigan, Tom Selleck grew up in Sherman Oaks, California. His journey towards building a large net worth began with humble origins. , Selleck pursued a business administration degree at the University of Southern California (USC) on a basketball scholarship. But, his interest shifted towards acting. leading him to study at the Hills Playhouse under Milton Katselas.
Minor roles in television and films marked Selleck's early career. He appeared in commercials and took on small parts in T.V. series such as "The Dating Game" and "Lancer." These initial steps, although modest. laid the groundwork for his future success and the growth of Tom Selleck net worth. Breakthrough with "Magnum, P.I."
The Role that Defined Tom Selleck's Career
Tom Selleck's breakthrough came with the role of Thomas Magnum in the CBS television series "Magnum, P.I." (1980-1988). This role made him a household name and boosted his net worth. The series' popularity resulted in Selleck earning large salaries. leading to financial stability and increased recognition in Hollywood.
"Magnum P.I." garnered high ratings and critical acclaim during its run. Selleck's portrayal of the charming and resourceful private investigator resonated with audiences. making him one of the most beloved television actors of the 1980s. The success of "Magnum P.I." played a pivotal role in shaping Tom Selleck net worth, establishing him as a major star.
Film Career and Diversification
Expanding Tom Selleck's Financial Portfolio
While "Magnum, P.I." was a cornerstone of Selleck's career, he did not limit himself to television. He ventured into films, further enhancing Tom Selleck net worth. His filmography includes notable movies such as "Three Men and a Baby" (1987). which became the highest-grossing film of the year, and its sequel, "Three Men and a Little Lady" (1990). These box office successes contributed to his wealth.
Selleck's versatility allowed him to transition between genres. from comedies like "Mr. Baseball" (1992) to westerns such as "Quigley Down Under" (1990). This diversification showcased his acting range. and provided many income streams, reinforcing Tom Selleck net worth.
Television Resurgence with "Blue Bloods"
Sustaining Wealth through Consistent Success
In 2010, Tom Selleck began starring as Frank Reagan i
From Slave to Scourge: The Existential Choice of Django Unchained. The Philos...Rodney Thomas Jr
#SSAPhilosophy #DjangoUnchained #DjangoFreeman #ExistentialPhilosophy #Freedom #Identity #Justice #Courage #Rebellion #Transformation
Welcome to SSA Philosophy, your ultimate destination for diving deep into the profound philosophies of iconic characters from video games, movies, and TV shows. In this episode, we explore the powerful journey and existential philosophy of Django Freeman from Quentin Tarantino’s masterful film, "Django Unchained," in our video titled, "From Slave to Scourge: The Existential Choice of Django Unchained. The Philosophy of Django Freeman!"
From Slave to Scourge: The Existential Choice of Django Unchained – The Philosophy of Django Freeman!
Join me as we delve into the existential philosophy of Django Freeman, uncovering the profound lessons and timeless wisdom his character offers. Through his story, we find inspiration in the power of choice, the quest for justice, and the courage to defy oppression. Django Freeman’s philosophy is a testament to the human spirit’s unyielding drive for freedom and justice.
Don’t forget to like, comment, and subscribe to SSA Philosophy for more in-depth explorations of the philosophies behind your favorite characters. Hit the notification bell to stay updated on our latest videos. Let’s discover the principles that shape these icons and the profound lessons they offer.
Django Freeman’s story is one of the most compelling narratives of transformation and empowerment in cinema. A former slave turned relentless bounty hunter, Django’s journey is not just a physical liberation but an existential quest for identity, justice, and retribution. This video delves into the core philosophical elements that define Django’s character and the profound choices he makes throughout his journey.
Link to video: https://youtu.be/GszqrXk38qk
Skeem Saam in June 2024 available on ForumIsaac More
Monday, June 3, 2024 - Episode 241: Sergeant Rathebe nabs a top scammer in Turfloop. Meikie is furious at her uncle's reaction to the truth about Ntswaki.
Tuesday, June 4, 2024 - Episode 242: Babeile uncovers the truth behind Rathebe’s latest actions. Leeto's announcement shocks his employees, and Ntswaki’s ordeal haunts her family.
Wednesday, June 5, 2024 - Episode 243: Rathebe blocks Babeile from investigating further. Melita warns Eunice to stay clear of Mr. Kgomo.
Thursday, June 6, 2024 - Episode 244: Tbose surrenders to the police while an intruder meddles in his affairs. Rathebe's secret mission faces a setback.
Friday, June 7, 2024 - Episode 245: Rathebe’s antics reach Kganyago. Tbose dodges a bullet, but a nightmare looms. Mr. Kgomo accuses Melita of witchcraft.
Monday, June 10, 2024 - Episode 246: Ntswaki struggles on her first day back at school. Babeile is stunned by Rathebe’s romance with Bullet Mabuza.
Tuesday, June 11, 2024 - Episode 247: An unexpected turn halts Rathebe’s investigation. The press discovers Mr. Kgomo’s affair with a young employee.
Wednesday, June 12, 2024 - Episode 248: Rathebe chases a criminal, resorting to gunfire. Turf High is rife with tension and transfer threats.
Thursday, June 13, 2024 - Episode 249: Rathebe traps Kganyago. John warns Toby to stop harassing Ntswaki.
Friday, June 14, 2024 - Episode 250: Babeile is cleared to investigate Rathebe. Melita gains Mr. Kgomo’s trust, and Jacobeth devises a financial solution.
Monday, June 17, 2024 - Episode 251: Rathebe feels the pressure as Babeile closes in. Mr. Kgomo and Eunice clash. Jacobeth risks her safety in pursuit of Kganyago.
Tuesday, June 18, 2024 - Episode 252: Bullet Mabuza retaliates against Jacobeth. Pitsi inadvertently reveals his parents’ plans. Nkosi is shocked by Khwezi’s decision on LJ’s future.
Wednesday, June 19, 2024 - Episode 253: Jacobeth is ensnared in deceit. Evelyn is stressed over Toby’s case, and Letetswe reveals shocking academic results.
Thursday, June 20, 2024 - Episode 254: Elizabeth learns Jacobeth is in Mpumalanga. Kganyago's past is exposed, and Lehasa discovers his son is in KZN.
Friday, June 21, 2024 - Episode 255: Elizabeth confirms Jacobeth’s dubious activities in Mpumalanga. Rathebe lies about her relationship with Bullet, and Jacobeth faces theft accusations.
Monday, June 24, 2024 - Episode 256: Rathebe spies on Kganyago. Lehasa plans to retrieve his son from KZN, fearing what awaits.
Tuesday, June 25, 2024 - Episode 257: MaNtuli fears for Kwaito’s safety in Mpumalanga. Mr. Kgomo and Melita reconcile.
Wednesday, June 26, 2024 - Episode 258: Kganyago makes a bold escape. Elizabeth receives a shocking message from Kwaito. Mrs. Khoza defends her husband against scam accusations.
Thursday, June 27, 2024 - Episode 259: Babeile's skillful arrest changes the game. Tbose and Kwaito face a hostage crisis.
Friday, June 28, 2024 - Episode 260: Two women face the reality of being scammed. Turf is rocked by breaking
240529_Teleprotection Global Market Report 2024.pdfMadhura TBRC
The teleprotection market size has grown
exponentially in recent years. It will grow from
$21.92 billion in 2023 to $28.11 billion in 2024 at a
compound annual growth rate (CAGR) of 28.2%. The
teleprotection market size is expected to see
exponential growth in the next few years. It will grow
to $70.77 billion in 2028 at a compound annual
growth rate (CAGR) of 26.0%.
Scandal! Teasers June 2024 on etv Forum.co.zaIsaac More
Monday, 3 June 2024
Episode 47
A friend is compelled to expose a manipulative scheme to prevent another from making a grave mistake. In a frantic bid to save Jojo, Phakamile agrees to a meeting that unbeknownst to her, will seal her fate.
Tuesday, 4 June 2024
Episode 48
A mother, with her son's best interests at heart, finds him unready to heed her advice. Motshabi finds herself in an unmanageable situation, sinking fast like in quicksand.
Wednesday, 5 June 2024
Episode 49
A woman fabricates a diabolical lie to cover up an indiscretion. Overwhelmed by guilt, she makes a spontaneous confession that could be devastating to another heart.
Thursday, 6 June 2024
Episode 50
Linda unwittingly discloses damning information. Nhlamulo and Vuvu try to guide their friend towards the right decision.
Friday, 7 June 2024
Episode 51
Jojo's life continues to spiral out of control. Dintle weaves a web of lies to conceal that she is not as successful as everyone believes.
Monday, 10 June 2024
Episode 52
A heated confrontation between lovers leads to a devastating admission of guilt. Dintle's desperation takes a new turn, leaving her with dwindling options.
Tuesday, 11 June 2024
Episode 53
Unable to resort to violence, Taps issues a verbal threat, leaving Mdala unsettled. A sister must explain her life choices to regain her brother's trust.
Wednesday, 12 June 2024
Episode 54
Winnie makes a very troubling discovery. Taps follows through on his threat, leaving a woman reeling. Layla, oblivious to the truth, offers an incentive.
Thursday, 13 June 2024
Episode 55
A nosy relative arrives just in time to thwart a man's fatal decision. Dintle manipulates Khanyi to tug at Mo's heartstrings and get what she wants.
Friday, 14 June 2024
Episode 56
Tlhogi is shocked by Mdala's reaction following the revelation of their indiscretion. Jojo is in disbelief when the punishment for his crime is revealed.
Monday, 17 June 2024
Episode 57
A woman reprimands another to stay in her lane, leading to a damning revelation. A man decides to leave his broken life behind.
Tuesday, 18 June 2024
Episode 58
Nhlamulo learns that due to his actions, his worst fears have come true. Caiphus' extravagant promises to suppliers get him into trouble with Ndu.
Wednesday, 19 June 2024
Episode 59
A woman manages to kill two birds with one stone. Business doom looms over Chillax. A sobering incident makes a woman realize how far she's fallen.
Thursday, 20 June 2024
Episode 60
Taps' offer to help Nhlamulo comes with hidden motives. Caiphus' new ideas for Chillax have MaHilda excited. A blast from the past recognizes Dintle, not for her newfound fame.
Friday, 21 June 2024
Episode 61
Taps is hungry for revenge and finds a rope to hang Mdala with. Chillax's new job opportunity elicits mixed reactions from the public. Roommates' initial meeting starts off on the wrong foot.
Monday, 24 June 2024
Episode 62
Taps seizes new information and recruits someone on the inside. Mary's new job
Hollywood Actress - The 250 hottest galleryZsolt Nemeth
Hollywood Actress amazon album eminent worldwide media, female-singer, actresses, alhletina-woman, 250 collection.
Highest and photoreal-print exclusive testament PC collage.
Focused television virtuality crime, novel.
The sheer afterlife of the work is activism-like hollywood-actresses point com.
173 Illustrate, 250 gallery, 154 blog, 120 TV serie logo, 17 TV president logo, 183 active hyperlink.
HD AI face enhancement 384 page plus Bowker ISBN, Congress LLCL or US Copyright.
Create a Seamless Viewing Experience with Your Own Custom OTT Player.pdfGenny Knight
As the popularity of online streaming continues to rise, the significance of providing outstanding viewing experiences cannot be emphasized enough. Tailored OTT players present a robust solution for service providers aiming to enhance their offerings and engage audiences in a competitive market. Through embracing customization, companies can craft immersive, individualized experiences that effectively hold viewers' attention, entertain them, and encourage repeat usage.
Create a Seamless Viewing Experience with Your Own Custom OTT Player.pdf
Analysis and design of algorithms part 3
1. G h R i dGraph Representation and
Traversals
Deepak John
Department Of Computer Applications, SJCET-Pala
2. Graph terminology - overviewp gy
A graph consists of
t f ti V { }◦ set of vertices V = {v1, v2, ….. vn}
◦ set of edges that connect the vertices E ={e1, e2, …. em}
Two vertices in a graph are adjacent if there is an edgeg p j g
connecting the vertices.
Two vertices are on a path if there is a sequences of vertices
beginning with the first one and ending with the second onebeginning with the first one and ending with the second one
Graphs with ordered edges are directed. For directed graphs,
vertices have in and out degrees.
W i h d G h h l i d i h d Weighted Graphs have values associated with edges.
Deepak John,Department Of IT,CE Poonjar
3. Graph representation – undirectedp p
h Adj li Adj igraph Adjacency list Adjacency matrix
Graph representation – directed
Deepak John,Department Of IT,CE Poonjar
graph Adjacency list Adjacency matrix
4. Adjacency Lists RepresentationAdjacency Lists Representation
A graph of n nodes is represented by a one-dimensional array L of
linked lists, where,
L[i] is the linked list containing all the nodes adjacent from node
i.
The nodes in the list L[i] are in no particular order
Deepak John,Department Of IT,CE Poonjar
5. Pros and Cons of Adjacency Matrices
P Pros:
Simple to implement
Easy and fast to tell if a pair (i,j) is an edge: simply check ify p ( ,j) g p y
A[i][j] is 1 or 0
Cons:
No matter how few edges the graph has the matrix takes O(n2) No matter how few edges the graph has, the matrix takes O(n2)
in memory
Pros and Cons of Adjacency Lists
Pros:
Saves on space (memory): the representation takes as many
memory words as there are nodes and edge.memory words as there are nodes and edge.
Cons:
It can take up to O(n) time to determine if a pair of nodes (i,j) is
d ld h t h th li k d li t L[i] hi h
Deepak John,Department Of IT,CE Poonjar
an edge: one would have to search the linked list L[i], which
takes time proportional to the length of L[i].
6. Graph Traversal TechniquesGraph Traversal Techniques
There are two standard graph traversal techniques:
Depth First Search (DFS) Depth-First Search (DFS)
Breadth-First Search (BFS)
In both DFS and BFS, the nodes of the undirected graph are, g p
visited in a systematic manner so that every node is visited
exactly one.
Both BFS and DFS give rise to a tree: Both BFS and DFS give rise to a tree:
When a node x is visited, it is labeled as visited, and it is added
to the tree
If h l d f d i i d h If the traversal got to node x from node y, y is viewed as the
parent of x, and x a child of y
Deepak John,Department Of IT,CE Poonjar
7. Depth-First SearchDepth-First Search
DFS follows the following rules:
S l t i it d d i it it d t t th t1. Select an unvisited node x, visit it, and treat as the current
node
2. Find an unvisited neighbor of the current node, visit it, andg
make it the new current node;
3. If the current node has no unvisited neighbors, backtrack to
the its parent and make that parent the new current node;the its parent, and make that parent the new current node;
4. Repeat steps 3 and 4 until no more nodes can be visited.
5. If there are still unvisited nodes, repeat from step 1.
Deepak John,Department Of IT,CE Poonjar
8. • It searches ‘deeper’ the graph when possible.
• Starts at the selected node and explores as far as possible alongStarts at the selected node and explores as far as possible along
each branch before backtracking.
• Vertices go through white, gray and black stages of color.
Whit i iti ll– White – initially
– Gray – when discovered first
– Black – when finished i.e. the adjacency list of the vertex isBlack when finished i.e. the adjacency list of the vertex is
completely examined.
• Also records timestamps for each vertex
d[ ] h th t i fi t di d– d[v]when the vertex is first discovered
– f[v] when the vertex is finished
Deepak John,Department Of IT,CE Poonjar
9. Depth-first search: Strategy (for digraph)
choose a starting vertex, distance d = 0
vertices are visited in order of increasing distance from the
starting vertex,
examine One edges leading from vertices (at distance d) to examine One edges leading from vertices (at distance d) to
adjacent vertices (at distance d+1)
then, examine One edges leading from vertices at distance d+1 to
distance d+2, and so on,
until no new vertex is discovered, or dead end
then backtrack one distance back up and try other edges and so then, backtrack one distance back up, and try other edges, and so
on
until finally backtrack to starting vertex, with no more new vertex
Deepak John,Department Of IT,CE Poonjar
to be discovered.
10. DFS(G)
1 for each vertex u ∈ V [G]
2 d l [ ] WHITE // l ll ti hit t th i t NIL2 do color[u] ← WHITE // color all vertices white, set their parents NIL
3 π[u] ← NIL
4 time ← 0 // zero out time
5 for each vertex u ∈ V [G] // call only for unexplored vertices5 for each vertex u ∈ V [G] // call only for unexplored vertices
6 do if color[u] = WHITE // this may result in multiple sources
7 then DFS-VISIT(u)
DFS-VISIT(u)
1 color[u] ← GRAY ▹White vertex u has just been discovered.
2 time ← time +12 time ← time +1
3 d[u] time // record the discovery time
4 for each v ∈ Adj[u] ▹Explore edge(u, v).
5 do if color[v] = WHITE5 do if color[v] WHITE
6 then π[v] ← u // set the parent value
7 DFS-VISIT(v) // recursive call
8 color[u] BLACK ▹ Blacken u; it is finished
Deepak John,Department Of IT,CE Poonjar
8 color[u] BLACK Blacken u; it is finished.
9 f [u] ▹ time ← time +1
11. forward edges- which point from a node of the tree to one of its
descendants
back edges-which point from a node to one of its ancestors
cross edges, is any other edge in graph G. It connects vertices in
two different DFS-tree or two vertices in the same DFS-tree neither
of which is the ancestor of the other.
tree edges edges which belong to the spanning tree itself are tree edges, edges which belong to the spanning tree itself, are
classified separately from forward edges
Deepak John,Department Of IT,CE Poonjar
13. Depth first search - analysisDepth first search analysis
Lines 1-3, initialization take time Θ(V).
Lines 5-7 take time Θ(V), excluding the time to call the DFS-
VISITVISIT.
DFS-VISIT is called only once for each node (since it’s called
only for white nodes and the first step in it is to paint the node
)gray).
Loop on line 4-7 is executed |Adj(v)| times. Since, ∑vєV |Adj(v)| =
Ө (E), the total cost of
DFS-VISIT it θ(E)
Th t t l t f DFS i θ(V+E)The total cost of DFS is θ(V+E)
Deepak John,Department Of IT,CE Poonjar
14. Breadth-First SearchBreadth First Search
BFS follows the following rules:
1 Select an unvisited node x visit it have it be the root in a BFS1. Select an unvisited node x, visit it, have it be the root in a BFS
tree being formed. Its level is called the current level.
2. From each node z in the current level, in the order in which
the level nodes were visited, visit all the unvisited neighbors
of z. The newly visited nodes from this level form a new level
that becomes the next current level.
3. Repeat step 2 until no more nodes can be visited.
4. If there are still unvisited nodes, repeat from Step 1.
Deepak John,Department Of IT,CE Poonjar
15. Breadth first search conceptsBreadth first search - concepts
• To keep track of progress, it colors each vertex - white, gray or
blackblack.
• All vertices start white.
• A vertex discovered first time during the search becomes
hinonwhite.
• All vertices adjacent to black ones are discovered. Whereas, gray
ones may have some white adjacent vertices.y j
• Gray represent the frontier between discovered and undiscovered
vertices.
Deepak John,Department Of IT,CE Poonjar
16. Breadth-first search: Strategy (for digraph)
choose a starting vertex, distance d = 0g ,
vertices are visited in order of increasing distance from the
starting vertex,
examine all edges leading from vertices (at distance d) to examine all edges leading from vertices (at distance d) to
adjacent vertices (at distance d+1)
then, examine all edges leading from vertices at distance d+1
t di t d+2 dto distance d+2, and so on,
until no new vertex is discovered
The predecessor of u is stored in the variable π[u]. The predecessor of u is stored in the variable π[u].
Deepak John,Department Of IT,CE Poonjar
17. BFS - algorithm
BFS(G, s) // G is the graph and s is the starting node
1 for each vertex u ∈ V [G] - {s}
2 do color[u] ← WHITE // color of vertex u[ ]
3 d[u] ← ∞ // distance from source s to vertex u
4 π[u] ← NIL // predecessor of u
5 color[s] ← GRAY
6 d[ ] 06 d[s] ← 0
7 π[s] ← NIL
8 Q ← Ø // Q is a FIFO - queue
9 ENQUEUE(Q, s)Q (Q, )
10 while Q ≠ Ø // iterates as long as there are gray vertices. Lines 10-18
11 do u ← DEQUEUE(Q)
12 for each v ∈ Adj[u]
13 d if l [ ] WHITE // di h di d dj i13 do if color[v] = WHITE // discover the undiscovered adjacent vertices
14 then color[v] ← GRAY // enqueued whenever painted gray
15 d[v] ← d[u] + 1
16 π[v] ← u
Deepak John,Department Of IT,CE Poonjar
16 π[v] u
17 ENQUEUE(Q, v)
18 color[u] ← BLACK // painted black whenever dequeued
19. Breadth first search - analysis
•The while-loop in breadth-first search is executed at most |V|
times. The reason is that every vertex enqueued at most once. So,y q ,
we have O(V).
•The for-loop inside the while-loop is executed at most |E| times
if G is a directed graph or 2|E| times if G is undirected Theif G is a directed graph or 2|E| times if G is undirected. The
reason is that every vertex dequeued at most once and we
examine (u, v) only when u is dequeued. Therefore, every edge
i d if di d i if di dexamined at most once if directed, at most twice if undirected.
So, we have O(E).
•Therefore, the total running time for breadth-first search, g
traversal is O(V + E).
Deepak John,Department Of IT,CE Poonjar
20. STRONGLY CONNECTED COMPONENTS OF A
DIRECTED GRAPHDIRECTED GRAPH
A directed graph is called strongly connected if there is a path
from each vertex in the graph to every other vertex.
The strongly connected components of a directed graph G are
its maximal strongly connected sub graphs.
Deepak John,Department Of IT,CE Poonjar
Graph with strongly connected components marked
21. PropertiesProperties
Reflexive property: For all a, a # a. Any vertex is strongly
connected to itself, by definition., y
Symmetric property: If a # b, then b # a. For strong connectivity,
this follows from the symmetry of the definition. The same two
th ( f t b d th f b t ) th t h th tpaths (one from a to b and another from b to a) that show that a ~
b, looked at in the other order (one from b to a and another from a
to b) show that b ~ a.
Transitive property: If a # b and b # c, then a # c. Let's expand
this out for strong connectivity: if a ~ b and b ~ c, we have four
paths: a b b a b c and c b Concatenating them in pairs a b cpaths: a-b, b-a, b-c, and c-b. Concatenating them in pairs a-b-c
and c-b-a produces two paths connecting a-c and c-a, so a ~ c,
showing that the transitive property holds for strong connectivity.
Deepak John,Department Of IT,CE Poonjar
22. Algorithm to Find Strongly Connected ComponentAlgorithm to Find Strongly Connected Component
Strategy:
Phase 1:
A standard depth-first search on G is performed, and the
vertices are put in a stack at their finishing times
Ph 2Phase 2:
A depth-first search is performed on GT, the transpose graph.
To start a search vertices are popped off the stack To start a search, vertices are popped off the stack.
A strongly connected component in the graph is identified by
the name of its starting vertex (call leader).
Deepak John,Department Of IT,CE Poonjar
26. Bi-connected components of an Undirected graph
Biconnected graph:
A connected undirected graph G is said to
b bi t d if it i t dbe biconnected if it remains connected
after removal of any one vertex and the
edges that are incident upon that vertex.
Bi t d t Biconnected component:
A biconnected component of a undirected
graph is a maximal biconnected subgraph,
that is a biconnected s bgraph notthat is, a biconnected subgraph not
contained in any larger biconnected
subgraph.
Artic lation point:Artic lation points are theArticulation point:Articulation points are the
points where the graph can be broken down
into its biconnected components
C is an articulation point C is an articulation point
Deepak John,Department Of IT,CE Poonjar
27. Discovery of Biconnected Components via
Articulation PointsArticulation Points
If we can find articulation points then can compute biconnected
components.
Idea:
• During DFS, use stack to store visited edges.
E h ti l t th DFS f t hild f ti l ti• Each time we complete the DFS of a tree child of an articulation
point, pop all stacked edges currently in stack
• These popped off edges form a biconnected component.p pp g p
Deepak John,Department Of IT,CE Poonjar
32. WHAT IS BINARY RELATION
A binary relation R from the set S to the set T is a subset
of S×T, R S×T. If S = T, we say that the relation is a binary
l i Srelation on S.
P ti f Bi R l ti Properties of Binary Relation
Let R be a binary relation on S.Then R is
1 Reflexive1. Reflexive
2. Symmetric
3 Anti-symmetric3. Anti-symmetric
4. Transitive
Deepak John,Department Of IT,CE Poonjar
33. Transitive closure of a graphTransitive closure of a graph
The problem: Given a directed graph, G = (V, E), find all of the
i h bl f i i Vvertices reachable from a given starting vertex v ϵV.
Transitive closure (definition): Let G = (V E) be a graph where x RTransitive closure (definition): Let G = (V, E) be a graph, where x R
y, y R z (x, y, z ϵ V). Then we can add a new edge x R z. A graph
containing all of the edges of this nature is called the transitive
closure of the original graph.
The best way to represent the transitive closure graph (TCG) is byThe best way to represent the transitive closure graph (TCG) is by
means of an adjacency matrix.
Deepak John,Department Of IT,CE Poonjar
34. Consider the following adjacency matrix on the left representing a
directed graph, the transitive closure is given on the right illustratingg p , g g g
which vertices can reach other vertices
•there is an edge from a to b and e b d b d•there is an edge from a to b and e.
•b can reach d
•d can reach c
h ll i
a b c d e a b c d e
a 0 1 0 0 1 1 1 1 1 1
b 0 0 0 1 0 0 1 1 1 0
•a can reach all vertices.
•But b cannot reach a
c 0 1 0 0 0 0 1 1 1 0
d 0 0 1 0 0 0 1 1 1 0
e 0 0 0 1 0 0 1 1 1 1e 0 0 0 1 0 0 1 1 1 1
Deepak John,Department Of IT,CE Poonjar
35. Strategy for Transitive ClosureStrategy for Transitive Closure
We noted earlier that if there is an path from a to b and from b to c,
then there is a path from a to c
Our strategy for deriving a transitive closure matrix will be based on
this simple idea
Start with a, compare it against each other vertex and see if there is, p g
an edge
if so, the corresponding matrix value is true
if not see if there is already a path known from some vertex c to if not, see if there is already a path known from some vertex c to
b and an edge from a to b, if so, then we know that there is a path
from a to b
Thi ill i th f 3 t d f l f th t ti This will require the use of 3 nested for-loops, one for the starting
vertex of a path, one for the destination vertex of a path, and one to
see if a path already exists from start to this point and from this
i d i i
Deepak John,Department Of IT,CE Poonjar
point to destination
36. It implies the following rules for generating R(k) from R(k-1):
RR((kk))[[i ji j]] == RR((kk--11))[[i ji j]] oror ((RR((kk--11))[[i ki k]] andand RR((kk--11))[[k jk j])])RR(( ))[[i,ji,j]] RR(( ))[[i,ji,j]] oror ((RR(( ))[[i,ki,k]] andand RR(( ))[[k,jk,j])])
Rule 1 If an element in row i and column j is 1 in R(k-1),it remains 1
in R(k)
Rule 2 If an element in row i and column j is 0 in R(k-1), it has to be
changed to 1 in R(k) if and only if the element in its row i and columnchanged to 1 in R(k) if and only if the element in its row i and column
k and the element in its column j and row k are both 1’s in R(k-1)
Constructs transitive closure T as the last matrix in the sequence of
n-by-n matrices R(0), … , R(k), … , R(n)
Note that R(0) = A (adjacency matrix), R(n) = T (transitive closure)
Deepak John,Department Of IT,CE Poonjar
38. It should be obvious that the complexity is O(n3) because of the 3
nested for-loops.
The result is an NxN matrix where entry R[i, j] is true if there is a
path from vertex i to vertex j.
The algorithm will work on either undirected or directed The algorithm will work on either undirected or directed
graphs
40. All-Pairs Shortest PathsAll Pairs Shortest Paths
Given a weighted graph G(V,E,w), the all-pairs shortest paths
problem is to find the shortest paths between all pairs of vertices
vi, vj ∈ V.
A number of algorithms are known for solving this problem A number of algorithms are known for solving this problem.
FLOYD’S ALGORITHM: ALL PAIRS SHORTEST PATHSFLOYD’S ALGORITHM: ALL PAIRS SHORTEST PATHS
Problem: In a weighted (di)graph, find shortest paths between every
pair of vertices
Same idea: construct solution through series of matrices D(0), …,D (n)
Deepak John,Department Of IT,CE Poonjar
41. Time efficiency: Θ(n3)
Space efficiency: Matrices can be written over their predecessors
Deepak John,Department Of IT,CE Poonjar
Space efficiency: Matrices can be written over their predecessors
43. Dynamic Programmingy g g
Dynamic Programming is an algorithm design technique for
optimization problems: often minimizing or maximizing.p p g g
Like divide and conquer, DP solves problems by combining
solutions to sub problems.
U lik di id d b bl t i d d t Unlike divide and conquer, sub problems are not independent.
Sub problems may share subsubproblems,
However, solution to one sub problem may not affect the solutions to other sub
bl f h blproblems of the same problem.
DP reduces computation by
Solving sub problems in a bottom-up fashion.g p p
Storing solution to a sub problem the first time it is solved.
Looking up the solution when sub problem is encountered again.
Key: determine structure of optimal solutions
Deepak John,Department Of IT,CE Poonjar
Key: determine structure of optimal solutions
44. Steps in Dynamic Programming
1 Characterize structure of an optimal solution1. Characterize structure of an optimal solution.
2. Define value of optimal solution recursively.
3. Compute optimal solution valuesp p
4. Construct an optimal solution from computed values.
Elements of Dynamic Programming
Optimal substructure
Overlapping subproblems
Deepak John,Department Of IT,CE Poonjar
45. Optimal Binary Search TreesOptimal Binary Search Trees
OBST is one special kind of advanced tree.
It focus on how to reduce the cost of the search of the BST It focus on how to reduce the cost of the search of the BST.
A good example of a dynamic algorithm
• Solves all the small problems
ild l i l bl f h• Builds solutions to larger problems from them
• Requires space to store small problem results
Deepak John,Department Of IT,CE Poonjar
46. Problem
Given sequence K = k1 < k2 <··· < kn of n sorted keys, with aq 1 2 n y ,
search probability pi for each key ki.
Want to build a binary search tree (BST)
with minimum expected search costwith minimum expected search cost.
Actual cost = number of items examined.
For key ki, cost = depthT(ki)+1, where For key ki, cost depthT(ki) 1, where
depthT(ki) = depth of ki in BST T .
TE ]incostsearch[
n
i
iiT pk
TE
1
)(depth1
]incostsearch[
i 1
48. p1 = 0.25, p2 = 0.2, p3 = 0.05, p4 = 0.2, p5 = 0.3.
i depthT(ki) depthT(ki)·pi
1 1 0.25
2 0 0
k2
2 0 0
3 3 0.15
4 2 0.4
5 1 0 3
k1 k5
5 1 0.3
1.10
k4
Therefore, E[search cost] = 2.10.
k3 This tree turns out to be optimal for this set of keys
Deepak John,Department Of IT,CE Poonjar
3 This tree turns out to be optimal for this set of keys.
49. Optimal Substructure
Any sub tree of a BST contains keys in a contiguous range ki,
..., kj Tj T
T’
If T is an optimal BST and T contains sub tree T’ with keys ki,
... ,kj , then T’must be an optimal BST for keys ki, ..., kj.
Deepak John,Department Of IT,CE Poonjar
, j , p y i, , j
1
50. Pseudo-code
OPTIMAL-BST(p, q, n)OPTIMAL-BST(p, q, n)(p q )
1. for i ← 1 to n + 1
2. do e[i, i 1] ← 0
3. w[i, i 1] ← 0
(p q )
1. for i ← 1 to n + 1
2. do e[i, i 1] ← 0
3. w[i, i 1] ← 0
4. for l ← 1 to n
5. do for i ← 1 to nl + 1
6. do j ←i + l1
4. for l ← 1 to n
5. do for i ← 1 to nl + 1
6. do j ←i + l1
7. e[i, j ]←∞
8. w[i, j ] ← w[i, j1] + pj
9. for r ←i to j
7. e[i, j ]←∞
8. w[i, j ] ← w[i, j1] + pj
9. for r ←i to j
10. do t ← e[i, r1] + e[r + 1, j ] + w[i, j ]
11. if t < e[i, j ]
12. then e[i, j ] ← t
10. do t ← e[i, r1] + e[r + 1, j ] + w[i, j ]
11. if t < e[i, j ]
12. then e[i, j ] ← t
13. root[i, j ] ←r
14. return e and root
13. root[i, j ] ←r
14. return e and root