Documentation for f1eddf4d65

This commit is contained in:
realstealthninja
2025-07-09 10:53:16 +00:00
parent e7edde96ab
commit b41207008f
2497 changed files with 31270 additions and 40283 deletions

View File

@@ -4,7 +4,7 @@
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.13.2"/>
<meta name="generator" content="Doxygen 1.14.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>TheAlgorithms/C++: dynamic_programming/word_break.cpp File Reference</title>
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
@@ -19,7 +19,6 @@
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../navtreedata.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../cookie.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
@@ -60,26 +59,20 @@ window.MathJax = {
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.13.2 -->
<!-- Generated by Doxygen 1.14.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(1); });
/* @license-end */
$(function() { codefold.init(); });
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('../../',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
@@ -94,10 +87,9 @@ $(function() {
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('d3/d84/word__break_8cpp.html','../../'); initResizable(true); });
/* @license-end */
$(function(){initNavTree('d3/d84/word__break_8cpp.html','../../',''); });
</script>
<div id="container">
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
@@ -121,9 +113,6 @@ $(function(){initNavTree('d3/d84/word__break_8cpp.html','../../'); initResizable
</div>
<div class="header">
<div class="summary">
<a href="#namespaces">Namespaces</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle"><div class="title">word_break.cpp File Reference</div></div>
</div><!--header-->
<div class="contents">
@@ -139,39 +128,32 @@ $(function(){initNavTree('d3/d84/word__break_8cpp.html','../../'); initResizable
</div><div class="textblock"><div class="dynheader">
Include dependency graph for word_break.cpp:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d2/d73/word__break_8cpp__incl.svg" width="540" height="126"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
<div class="center"><iframe scrolling="no" loading="lazy" frameborder="0" src="../../d2/d73/word__break_8cpp__incl.svg" width="540" height="126"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div>
<p><a href="../../d3/d84/word__break_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="namespaces" name="namespaces"></a>
<tr class="heading"><td colspan="2"><h2 id="header-namespaces" class="groupheader"><a id="namespaces" name="namespaces"></a>
Namespaces</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d24/namespacedynamic__programming.html">dynamic_programming</a></td></tr>
<tr class="memitem:dynamic_5Fprogramming" id="r_dynamic_5Fprogramming"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d24/namespacedynamic__programming.html">dynamic_programming</a></td></tr>
<tr class="memdesc:dd/d24/namespacedynamic__programming"><td class="mdescLeft">&#160;</td><td class="mdescRight">Dynamic Programming algorithms. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d6/d53/namespaceword__break.html">word_break</a></td></tr>
<tr class="memitem:word_5Fbreak" id="r_word_5Fbreak"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d6/d53/namespaceword__break.html">word_break</a></td></tr>
<tr class="memdesc:d6/d53/namespaceword__break"><td class="mdescLeft">&#160;</td><td class="mdescRight">Functions for <a href="https://leetcode.com/problems/word-break/" target="_blank">Word Break</a> problem. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
<tr class="heading"><td colspan="2"><h2 id="header-func-members" class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a1cc9dd6e6190d10a010fdcdfe7a21a81" id="r_a1cc9dd6e6190d10a010fdcdfe7a21a81"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a1cc9dd6e6190d10a010fdcdfe7a21a81">dynamic_programming::word_break::exists</a> (const std::string &amp;str, const std::unordered_set&lt; std::string &gt; &amp;strSet)</td></tr>
<tr class="memdesc:a1cc9dd6e6190d10a010fdcdfe7a21a81"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function that checks if the string passed in param is present in the the <a class="el" href="../../d3/d6d/classunordered__set.html" title="STL class.">unordered_set</a> passed. <br /></td></tr>
<tr class="separator:a1cc9dd6e6190d10a010fdcdfe7a21a81"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a272b0f5cdb4e41fd6dee4538b808c06a" id="r_a272b0f5cdb4e41fd6dee4538b808c06a"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a272b0f5cdb4e41fd6dee4538b808c06a">dynamic_programming::word_break::check</a> (const std::string &amp;s, const std::unordered_set&lt; std::string &gt; &amp;strSet, int pos, std::vector&lt; int &gt; *dp)</td></tr>
<tr class="memdesc:a272b0f5cdb4e41fd6dee4538b808c06a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function that checks if the string passed in param can be segmented from position 'pos', and then correctly go on to segment the rest of the string correctly as well to reach a solution. <br /></td></tr>
<tr class="separator:a272b0f5cdb4e41fd6dee4538b808c06a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afe4dcd6fd5282e535685361cba645d7c" id="r_afe4dcd6fd5282e535685361cba645d7c"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#afe4dcd6fd5282e535685361cba645d7c">dynamic_programming::word_break::wordBreak</a> (const std::string &amp;s, const std::vector&lt; std::string &gt; &amp;wordDict)</td></tr>
<tr class="memdesc:afe4dcd6fd5282e535685361cba645d7c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function that checks if the string passed in param can be segmented into the strings present in the vector. In others words, it checks if any permutation of strings in the vector can be concatenated to form the final string. <br /></td></tr>
<tr class="separator:afe4dcd6fd5282e535685361cba645d7c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa8dca7b867074164d5f45b0f3851269d" id="r_aa8dca7b867074164d5f45b0f3851269d"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aa8dca7b867074164d5f45b0f3851269d">test</a> ()</td></tr>
<tr class="memdesc:aa8dca7b867074164d5f45b0f3851269d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test implementations. <br /></td></tr>
<tr class="separator:aa8dca7b867074164d5f45b0f3851269d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae66f6b31b5ad750f1fe042a706a4e3d4" id="r_ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</td></tr>
<tr class="memdesc:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Main function. <br /></td></tr>
<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<a name="details" id="details"></a><h2 id="header-details" class="groupheader">Detailed Description</h2>
<div class="textblock"><p><a href="https://leetcode.com/problems/word-break/" target="_blank">Word Break Problem</a> </p>
<p>Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if s can be segmented into a space-separated sequence of one or more dictionary words.</p>
<p>Note: The same word in the dictionary may be reused multiple times in the segmentation. You may assume the dictionary does not contain duplicate words.</p>
@@ -182,7 +164,7 @@ pen apple". Note that you are allowed to reuse a dictionary word.</p>
<dl class="section author"><dt>Author</dt><dd>[Akshay Anand] (<a href="https://github.com/axayjha">https://github.com/axayjha</a>) </dd></dl>
<p class="definition">Definition in file <a class="el" href="../../d3/d84/word__break_8cpp_source.html">word_break.cpp</a>.</p>
</div><h2 class="groupheader">Function Documentation</h2>
</div><a name="doc-func-members" id="doc-func-members"></a><h2 id="header-doc-func-members" class="groupheader">Function Documentation</h2>
<a id="a272b0f5cdb4e41fd6dee4538b808c06a" name="a272b0f5cdb4e41fd6dee4538b808c06a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a272b0f5cdb4e41fd6dee4538b808c06a">&#9670;&#160;</a></span>check()</h2>
@@ -222,9 +204,9 @@ pen apple". Note that you are allowed to reuse a dictionary word.</p>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if a valid solution/segmentation is possible by segmenting at index pos </dd>
<dl class="section return"><dt>Returns</dt><dd><span class="tt">true</span> if a valid solution/segmentation is possible by segmenting at index pos </dd>
<dd>
<code>false</code> otherwise </dd></dl>
<span class="tt">false</span> otherwise </dd></dl>
<p class="definition">Definition at line <a class="el" href="../../d3/d84/word__break_8cpp_source.html#l00080">80</a> of file <a class="el" href="../../d3/d84/word__break_8cpp_source.html">word_break.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 81</span> {</div>
@@ -295,9 +277,9 @@ pen apple". Note that you are allowed to reuse a dictionary word.</p>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if str is present in strSet </dd>
<dl class="section return"><dt>Returns</dt><dd><span class="tt">true</span> if str is present in strSet </dd>
<dd>
<code>false</code> if str is not present in strSet </dd></dl>
<span class="tt">false</span> if str is not present in strSet </dd></dl>
<p class="definition">Definition at line <a class="el" href="../../d3/d84/word__break_8cpp_source.html#l00060">60</a> of file <a class="el" href="../../d3/d84/word__break_8cpp_source.html">word_break.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 61</span> {</div>
@@ -353,7 +335,7 @@ pen apple". Note that you are allowed to reuse a dictionary word.</p>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static void test </td>
<td class="memname">void test </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></td>
@@ -414,9 +396,9 @@ pen apple". Note that you are allowed to reuse a dictionary word.</p>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if s can be formed by a combination of strings present in wordDict </dd>
<dl class="section return"><dt>Returns</dt><dd><span class="tt">true</span> if s can be formed by a combination of strings present in wordDict </dd>
<dd>
<code>false</code> otherwise </dd></dl>
<span class="tt">false</span> otherwise </dd></dl>
<p class="definition">Definition at line <a class="el" href="../../d3/d84/word__break_8cpp_source.html#l00131">131</a> of file <a class="el" href="../../d3/d84/word__break_8cpp_source.html">word_break.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 131</span> {</div>
@@ -441,11 +423,19 @@ pen apple". Note that you are allowed to reuse a dictionary word.</p>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="page-nav" class="page-nav-panel">
<div id="page-nav-resize-handle"></div>
<div id="page-nav-tree">
<div id="page-nav-contents">
</div><!-- page-nav-contents -->
</div><!-- page-nav-tree -->
</div><!-- page-nav -->
</div><!-- container -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_8a20dd5bfd5341a725342bf72b6b686f.html">dynamic_programming</a></li><li class="navelem"><a class="el" href="../../d3/d84/word__break_8cpp.html">word_break.cpp</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
<li class="navelem"><a href="../../dir_8a20dd5bfd5341a725342bf72b6b686f.html">dynamic_programming</a></li><li class="navelem"><a href="../../d3/d84/word__break_8cpp.html">word_break.cpp</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.14.0 </li>
</ul>
</div>
</body>