"use strict";(self.webpackChunkfi=self.webpackChunkfi||[]).push([[6234],{3905:(e,t,a)=>{a.d(t,{Zo:()=>p,kt:()=>d});varn=a(7294);functionr(e,t,a){returntine?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}functioni(e,t){vara=Object.keys(e);if(Object.getOwnPropertySymbols){varn=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){returnObject.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}returna}functions(e){for(vart=1;t<arguments.length;t++){vara=null!=arguments[t]?arguments[t]:{};t%2?i(Object(a),!0).forEach((function(t){r(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):i(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}returne}functiono(e,t){if(null==e)return{};vara,n,r=function(e,t){if(null==e)return{};vara,n,r={},i=Object.keys(e);for(n=0;n<i.length;n++)a=i[n],t.indexOf(a)>=0||(r[a]=e[a]);returnr}(e,t);if(Object.getOwnPropertySymbols){vari=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)a=i[n],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}returnr}varm=n.createContext({}),l=function(e){vart=n.useContext(m),a=t;returne&&(a="function"==typeofe?e(t):s(s({},t),e)),a},p=function(e){vart=l(e.components);returnn.createElement(m.Provider,{value:t},e.children)},c="mdxType",h={inlineCode:"code",wrapper:function(e){vart=e.children;returnn.createElement(n.Fragment,{},t)}},u=n.forwardRef((function(e,t){vara=e.components,r=e.mdxType,i=e.originalType,m=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),c=l(a),u=r,d=c["".concat(m,".").concat(u)]||c[u]||h[u]||i;returna?n.createElement(d,s(s({ref:t},p),{},{components:a})):n.createElement(d,s({ref:t},p))}));functiond(e,t){vara=arguments,r=t&&t.mdxType;if("string"==typeofe||r){vari=a.length,s=newArray(i);s[0]=u;varo={};for(varmint)hasOwnProperty.call(t,m)&&(o[m]=t[m]);o.originalType=e,o[c]="string"==typeofe?e:r,s[1]=o;for(varl=2;l<i;l++)s[l]=a[l];returnn.createElement.apply(null,s)}returnn.createElement.apply(null,a)}u.displayName="MDXCreateElement"},4507:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>m,contentTitle:()=>s,default:()=>h,frontMatter:()=>i,metadata:()=>o,toc:()=>l});varn=a(7462),r=(a(7294),a(3905));consti={id:"iterative-and-iterators",title:"Iterative algorithms via iterators",description:"Iterative DFS using iterators.\n",tags:["csharp","graphs","iterators","iterative"],last_update:{date:newDate("2021-05-18T00:00:00.000Z")}},s=void0,o={unversionedId:"graphs/iterative-and-iterators",id:"graphs/iterative-and-iterators",title:"Iterative algorithms via iterators",description:"Iterative DFS using iterators.\n",source:"@site/ib002/10-graphs/2021-05-18-iterative-and-iterators.md",sourceDirName:"10-graphs",slug:"/graphs/iterative-and-iterators",permalink:"/ib002/graphs/iterative-and-iterators",draft:!1,editUrl:"https://github.com/mfocko/blog/tree/main/ib002/10-graphs/2021-05-18-iterative-and-iterators.md",tags:[{label:"csharp",permalink:"/ib002/tags/csharp"},{label:"graphs",permalink:"/ib002/tags/graphs"},{label:"iterators",permalink:"/ib002/tags/iterators"},{label:"iterative",permalink:"/ib002/tags/iterative"}],version:"current",lastUpdatedAt:1621296e3,formattedLastUpdatedAt:"May 18, 2021",frontMatter:{id:"iterative-and-iterators",title:"Iterative algorithms via iterators",description:"Iterative DFS using iterators.\n",tags:["csharp","graphs","iterators","iterative"],last_update:{date:"2021-05-18T00:00:00.000Z"}},sidebar:"autogeneratedBar",previous:{title:"Graphs",permalink:"/ib002/category/graphs"},next:{title:"Distance boundaries from BFS tree on undirected graphs",permalink:"/ib002/graphs/bfs-tree"}},m={},l=[{value:"Introduction",id:"introduction",level:2},{value:"Different implementations",id:"different-implementations",level:2},{value:"Recursive DFS implementation from exercises without colors",id:"recursive-dfs-implementation-from-exercises-without-colors",level:3},{value:"Iterative DFS from the exercises",id: