Here is one hour link.
From January 2015, she started to practice leetcode questions; she trains herself to stay focus, develops "muscle" memory when she practices those questions one by one. 2015年初, Julia开始参与做Leetcode, 开通自己第一个博客. 刷Leet code的题目, 她看了很多的代码, 每个人那学一点, 也开通Github, 发表自己的代码, 尝试写自己的一些体会. She learns from her favorite sports – tennis, 10,000 serves practice builds up good memory for a great serve. Just keep going. Hard work beats talent when talent fails to work hard.
Tuesday, October 29, 2019
10 Lessons on Time Management from Bill Gates
Here is the article.
2. Put in the Hours
Malcom Gladwell used in his book Outliers on how the most successful individuals put in at least 10,000 hours of work before becoming successful.
You can say no, you can ignore that one ridiculous email, you can delegate things. You can leave unimportant things for later. Again, YOU CAN SAY NO! Don’t take care of everything that comes your way. Don’t say yes to everyone. Schedule your time and prioritize.
- Take your time seriously
- Put in the hours
- Structure your time
- Don't waste time to make more time
- Get sleep
- Take advantage of snippets of time
- Think long term and invest your time
- Prioritize
- Chunk your time int topics
- Use software
2. Put in the Hours
Malcom Gladwell used in his book Outliers on how the most successful individuals put in at least 10,000 hours of work before becoming successful.
You can say no, you can ignore that one ridiculous email, you can delegate things. You can leave unimportant things for later. Again, YOU CAN SAY NO! Don’t take care of everything that comes your way. Don’t say yes to everyone. Schedule your time and prioritize.
Monday, October 28, 2019
7 Lessons on Time Management From Bill Gates (Productivity Hacks)
Here is the link.
Top 7 productivity tips
buy anything I want, not buy time
1. think long term
big rock -> pebbles -> sand
Do important task first -> small task -> ...
chunk your time
Ruthless say no to things
Top 7 productivity tips
buy anything I want, not buy time
1. think long term
big rock -> pebbles -> sand
Do important task first -> small task -> ...
chunk your time
Ruthless say no to things
Time management crash course last two month in 2019
Oct. 28, 2019
It is time for me to learn how to value my own time. I have to list things to distract me, and then I have to work hard to focus on things I can break through.
I like to go over a list to figure out how many hours I wasted in 2019.
I need to look into and work on some research on this topic.
Introduction
It is time for me to learn how to value my own time. I have to list things to distract me, and then I have to work hard to focus on things I can break through.
Time wasted
I like to go over a list to figure out how many hours I wasted in 2019.
Time management crash course
I need to look into and work on some research on this topic.
How to stay connected to China and keep relatives happy?
Oct. 28, 2019
It is my personal finance research. I like to figure out how many hours I spend in a year to chat with relatives in China. I am a single person and 53 years old, I like to figure out how to make a living in Canada.
The idea is to look into how efficient I am compared to 20 years ago. I used to spend a few time $200/ month US dollars on long distance calls to China from 1999 to 2001.
I think that I was not efficient to communicate with relatives. I used to pay 65 cent/ minute in US dollar for long distance call from 1996 to 2000.
I used to talk to my mom every day later when the calling card was cheaper after 2000.
I have to learn how to discipline myself. Do not waste time and money.
I like to challenge myself. Do not spend time on wechat. Cut time to minimum.
Introduction
It is my personal finance research. I like to figure out how many hours I spend in a year to chat with relatives in China. I am a single person and 53 years old, I like to figure out how to make a living in Canada.
How many hours?
The idea is to look into how efficient I am compared to 20 years ago. I used to spend a few time $200/ month US dollars on long distance calls to China from 1999 to 2001.
I think that I was not efficient to communicate with relatives. I used to pay 65 cent/ minute in US dollar for long distance call from 1996 to 2000.
I used to talk to my mom every day later when the calling card was cheaper after 2000.
I have to learn how to discipline myself. Do not waste time and money.
Being frugal
I like to challenge myself. Do not spend time on wechat. Cut time to minimum.
C#: List class API
Oct. 28, 2019
It is time for me to learn all API of C# List class. I like to figure out how to expedite my coding using C#.
I was so surprised to read C# code written by one of senior engineers, and then I asked myself how come I never used those two APIs.
Here is the link.
Here is to learn IEnumerable.Skip, IEnumerable.Take API.
Array's available method and function are listed in the following, 72 options. I like to memorize all of them, and a few words are new to me. I like to get to know those methods first.
0
Add
AddRange
AsReadOnly
BinarySearch
Clear
Contains
ConvertAll
CopyTo
Exists
Find
FindAll
FindIndex
FindLast
FindLastIndex
1
Introduction
It is time for me to learn all API of C# List class. I like to figure out how to expedite my coding using C#.
Motivation
I was so surprised to read C# code written by one of senior engineers, and then I asked myself how come I never used those two APIs.
Here is the link.
Here is to learn IEnumerable.Skip, IEnumerable.Take API.
Array's APIs
Array's available method and function are listed in the following, 72 options. I like to memorize all of them, and a few words are new to me. I like to get to know those methods first.
0
Add
AddRange
AsReadOnly
BinarySearch
Clear
Contains
ConvertAll
CopyTo
Exists
Find
FindAll
FindIndex
FindLast
FindLastIndex
| Aggregate |
| All |
| Any |
| AsEnumerable |
| AsParallel |
| AsParallel<> |
| AsQuerable |
| AsQuerable<> |
| Average |
| Average<> 2 |
| Cast<> |
| Clone |
| Concat<> |
| Contain<> |
| CopyTo<> |
| Count<> |
| DefaultIfEmpty |
| Distinct |
| ElementAt |
| ElementAtOrDefault 3 |
| Equals |
| Except<> |
| FirstOrDefault<> |
| First<> |
| GetEnumerator |
| GetHashCode |
| GetLength |
| GetLongLength |
| GetLowerBound |
| GetType 4 |
| GetUpperBound |
| GetType |
| GetUpperBound |
| GetValue |
| GroupBy |
| GroupJoin |
| Initialize |
| Intersect |
| Join |
| Last 5 |
| LastOrDefault |
| Length |
| IsFixedSize |
| IsReadONly |
| IsSyncrhonized |
| Max |
| Max<> |
| Min |
| Min<> |
| OfType<> 6 |
| OrderBy<> |
| OrderByDescending<> |
| Rank |
| Reverse<> |
| Select<> |
| SelectMany<> |
| SequenceEqual<> |
| SetValue |
| Single<> |
| SingleOrDefault<> 7 |
| Skip<> |
| SkipWhile<> |
| Sum |
| Sum<> |
| SyncRoot |
| Take<> |
| TakeWhile |
| ToArray |
| ToDictionary |
| ToList 8 |
| ToLookup |
| ToString |
| Union<> |
| Where<> |
| Zip |
What is value after 18 years Oracle stock?
Oct. 28, 2019
It is my research to figure out 100 share of Oracle stock purchased in 2001 with price 11.00 dollars.
Here is the page to include my purchase in 2001, after I just got laidoff a few months, I made some purchase on Oracle stock.
2001, Sept. 11, 100 share $11.00
Sold 70 share, $15.80, Jan. 11, 2002
Here is the link to check Oracle stock price history.
Introduction
It is my research to figure out 100 share of Oracle stock purchased in 2001 with price 11.00 dollars.
Problem solving
Here is the page to include my purchase in 2001, after I just got laidoff a few months, I made some purchase on Oracle stock.
2001, Sept. 11, 100 share $11.00
Sold 70 share, $15.80, Jan. 11, 2002
Here is the link to check Oracle stock price history.
| Oracle Historical Annual Stock Price Data | ||||||
|---|---|---|---|---|---|---|
| Year | Average Stock Price | Year Open | Year High | Year Low | Year Close | Annual % Change |
| 2019 | 53.5989 | 45.2200 | 60.1500 | 44.7800 | 54.6400 | 21.02% |
| 2018 | 48.0500 | 46.6300 | 52.9700 | 42.6900 | 45.1500 | -4.51% |
| 2017 | 46.5247 | 38.5500 | 52.8000 | 38.4500 | 47.2800 | 22.96% |
| 2016 | 39.2267 | 35.7500 | 41.7700 | 33.9400 | 38.4500 | 5.26% |
| 2015 | 40.7971 | 44.3300 | 44.9100 | 35.4400 | 36.5300 | -18.77% |
| 2014 | 40.1197 | 37.8400 | 46.2300 | 35.8400 | 44.9700 | 17.54% |
| 2013 | 33.6779 | 34.6900 | 38.2600 | 29.9600 | 38.2600 | 14.83% |
| 2012 | 29.8022 | 25.8650 | 34.0900 | 25.6100 | 33.3200 | 29.90% |
| 2011 | 31.3691 | 31.6200 | 36.3700 | 24.7800 | 25.6500 | -18.05% |
| 2010 | 25.4572 | 24.8500 | 31.7600 | 21.4600 | 31.3000 | 27.60% |
| 2009 | 20.1158 | 18.4100 | 25.0100 | 13.8500 | 24.5300 | 38.35% |
| 2008 | 20.0030 | 22.4900 | 23.5200 | 15.4000 | 17.7300 | -21.48% |
| 2007 | 19.5037 | 17.5100 | 23.0400 | 16.2900 | 22.5800 | 31.74% |
| 2006 | 15.2314 | 12.6000 | 19.6600 | 12.2000 | 17.1400 | 40.38% |
| 2005 | 12.8311 | 13.4100 | 14.0500 | 11.5200 | 12.2100 | -11.01% |
| 2004 | 12.1210 | 13.1400 | 14.8900 | 9.8600 | 13.7200 | 3.70% |
| 2003 | 12.2054 | 11.2100 | 13.7600 | 10.6800 | 13.2300 | 22.50% |
| 2002 | 11.0963 | 13.9800 | 17.2600 | 7.3210 | 10.8000 | -21.80% |
| 2001 | 17.6158 | 26.3800 | 34.5600 | 10.7600 | 13.8100 | -52.48% |
| 2000 | 35.4011 | 29.5250 | 46.3150 | 22.3100 | 29.0600 | 3.69% |
| 1999 | 10.5125 | 7.1667 | 28.0250 | 5.3600 | 28.0250 | 288.79% |
| 1998 | 4.5371 | 3.8333 | 7.4167 | 3.0100 | 7.2083 | 93.86% |
| 1997 | 5.2165 | 4.6667 | 6.8550 | 3.5100 | 3.7183 | -19.85% |
| 1996 | 4.1556 | 3.2037 | 5.5278 | 2.9630 | 4.6389 | 47.77% |
| 1995 | 2.7567 | 2.1170 | 3.5652 | 2.0617 | 3.1393 | 44.08% |
| 1994 | 1.8443 | 1.4074 | 2.2716 | 1.3269 | 2.1788 | 53.46% |
| 1993 | 1.1620 | 0.7067 | 1.8519 | 0.6975 | 1.4198 | 102.63% |
| 1992 | 0.4548 | 0.3672 | 0.7007 | 0.3086 | 0.7007 | 95.73% |
| 1991 | 0.2592 | 0.1975 | 0.4012 | 0.1390 | 0.3580 | 84.25% |
| 1990 | 0.3811 | 0.5958 | 0.6943 | 0.1328 | 0.1943 | -66.33% |
| 1989 | 0.4184 | 0.2346 | 0.6358 | 0.2346 | 0.5770 | 139.72% |
| 1988 | 0.2115 | 0.1883 | 0.2747 | 0.1451 | 0.2407 | 34.47% |
| 1987 | 0.1423 | 0.0640 | 0.2299 | 0.0640 | 0.1790 | 179.69% |
| Sector | Industry | Market Cap | Revenue |
|---|---|---|---|
| Computer and Technology | Computer Software | $177.814B | $39.506B |
Does Market Timing Ever Work?
Here is the link.
Even the most rational index investors might catch themselves wondering if they should sell some of their equities, or delay investing new cash, because of expected market volatility, or reports of record high stock prices.
Even the most rational index investors might catch themselves wondering if they should sell some of their equities, or delay investing new cash, because of expected market volatility, or reports of record high stock prices.
10 X Rule - 3 middle level algorithm one hour
I like to aim 10X high goal and use 10x more energy, based on 10 X rule book.
What is CAPE ratio?
CAPE比率
高估值会侵蚀未来的收益。Robert Shiller 说,美国股市的CAPE比率目前处于29的高位。CAPE比率,即经周期调整的市盈率,考察的是投资者为10年期间经通胀因素调整后的平均收益支付了多少钱。这一指标显示出剔除短期扭曲因素后市场的成本有多高。
席勒表示,现在CAPE为29,这种情况在历史上只发生过几次,到了1929年至30年代中期的水平。他补充称,在非理性繁荣泡沫破灭之前,CAPE仍可能继续上升。目前的CAPE略高于1987年的水平,当时美囯股市在1987年10月19日创下了23%的最大单日跌幅。
高估值会侵蚀未来的收益。Robert Shiller 说,美国股市的CAPE比率目前处于29的高位。CAPE比率,即经周期调整的市盈率,考察的是投资者为10年期间经通胀因素调整后的平均收益支付了多少钱。这一指标显示出剔除短期扭曲因素后市场的成本有多高。
席勒表示,现在CAPE为29,这种情况在历史上只发生过几次,到了1929年至30年代中期的水平。他补充称,在非理性繁荣泡沫破灭之前,CAPE仍可能继续上升。目前的CAPE略高于1987年的水平,当时美囯股市在1987年10月19日创下了23%的最大单日跌幅。
SPDR - Portfolio Aggregate Bond ETF
SPDR Portfolio Aggregate Bond ETF (SPAB)
席勒对债券的担忧和对美国股市的担忧一样多。债券目前是最热门的资产类别之一,因为投资者寻求安全的收入。SPDR Portfolio Aggregate Bond ETF (SPAB)今年的总回报率与股票相当,为8.31%。这是过去10年3.7%的平均年回报率的两倍多。
席勒对债券的担忧和对美国股市的担忧一样多。债券目前是最热门的资产类别之一,因为投资者寻求安全的收入。SPDR Portfolio Aggregate Bond ETF (SPAB)今年的总回报率与股票相当,为8.31%。这是过去10年3.7%的平均年回报率的两倍多。
2019 best sectors
Real Estate Select Sector ETF, XLRE
SPDR ETF (XLK)
房地产类股也很火爆。房地产精选行业ETF (Real Estate Select Sector ETF, XLRE)仅今年就上涨了近29%,超过了标准普尔500指数20%的涨幅。房地产类股仅以微弱优势落后于科技精选板块SPDR ETF (XLK),成为今年表现最佳的板块。
SPDR ETF (XLK)
房地产类股也很火爆。房地产精选行业ETF (Real Estate Select Sector ETF, XLRE)仅今年就上涨了近29%,超过了标准普尔500指数20%的涨幅。房地产类股仅以微弱优势落后于科技精选板块SPDR ETF (XLK),成为今年表现最佳的板块。
Robert Shiller - 2019 finance analysis
Robert Shiller
近日,曾准确预测到2000年的美股崩盘和2007年的房地产市场崩盘的耶鲁大学经济学教授、诺贝尔奖得主罗伯特•席勒(Robert Shiller)表示,美国金融市场泡沫无处不在,无论是股票市场、债券市场还是房地产市场,投资者都无路可逃。
席勒发出这一不祥警告之际,正值华尔街股灾90周年。1929年10月28日,道琼斯工业股票平均价格指数下跌13%,这是历史上第二大跌幅。再加上大萧条初期股市的重挫,华尔街花了25年时间才恢复元气。
他预计未来30年美国股市的平均年回报率只有4.4%。这不到标准普尔500指数长期回报率的一半,也远远低于养老金的要求。
美股的市值过高
目前美国股市较2009年3月9日的低点上涨了348%,为投资者的投资组合增加了近29万亿美元。
CAPE比率
高估值会侵蚀未来的收益。他说,美国股市的CAPE比率目前处于29的高位。CAPE比率,即经周期调整的市盈率,考察的是投资者为10年期间经通胀因素调整后的平均收益支付了多少钱。这一指标显示出剔除短期扭曲因素后市场的成本有多高。
席勒表示,现在CAPE为29,这种情况在历史上只发生过几次,到了1929年至30年代中期的水平。他补充称,在非理性繁荣泡沫破灭之前,CAPE仍可能继续上升。目前的CAPE略高于1987年的水平,当时美囯股市在1987年10月19日创下了23%的最大单日跌幅。
SPDR Portfolio Aggregate Bond ETF (SPAB)
席勒对债券的担忧和对美国股市的担忧一样多。债券目前是最热门的资产类别之一,因为投资者寻求安全的收入。SPDR Portfolio Aggregate Bond ETF (SPAB)今年的总回报率与股票相当,为8.31%。这是过去10年3.7%的平均年回报率的两倍多。
债券ETF
投资者将大量资金投入债券ETF,希望避开股市波动,至少获得一些回报。“它(债券泡沫)似乎与人们没有给予足够的关注有关,通过简单的逻辑思考就能知道,这不可能继续下去,它最终会有糟糕的结局,它可能会在某个时候沉没。”
席勒说,美国房地产市场正处于泡沫阶段,与2005年没有什么不同。“这就像又回到了2005年。旧金山和洛杉矶的房市已经在放缓。”他说,这是一个“糟糕的指标”,因为这些市场多年来一直在上涨。
Real Estate Select Sector ETF, XLRE
SPDR ETF (XLK)
房地产类股也很火爆。房地产精选行业ETF (Real Estate Select Sector ETF, XLRE)仅今年就上涨了近29%,超过了标准普尔500指数20%的涨幅。房地产类股仅以微弱优势落后于科技精选板块SPDR ETF (XLK),成为今年表现最佳的板块。
近日,曾准确预测到2000年的美股崩盘和2007年的房地产市场崩盘的耶鲁大学经济学教授、诺贝尔奖得主罗伯特•席勒(Robert Shiller)表示,美国金融市场泡沫无处不在,无论是股票市场、债券市场还是房地产市场,投资者都无路可逃。
席勒发出这一不祥警告之际,正值华尔街股灾90周年。1929年10月28日,道琼斯工业股票平均价格指数下跌13%,这是历史上第二大跌幅。再加上大萧条初期股市的重挫,华尔街花了25年时间才恢复元气。
他预计未来30年美国股市的平均年回报率只有4.4%。这不到标准普尔500指数长期回报率的一半,也远远低于养老金的要求。
美股的市值过高
目前美国股市较2009年3月9日的低点上涨了348%,为投资者的投资组合增加了近29万亿美元。
CAPE比率
高估值会侵蚀未来的收益。他说,美国股市的CAPE比率目前处于29的高位。CAPE比率,即经周期调整的市盈率,考察的是投资者为10年期间经通胀因素调整后的平均收益支付了多少钱。这一指标显示出剔除短期扭曲因素后市场的成本有多高。
席勒表示,现在CAPE为29,这种情况在历史上只发生过几次,到了1929年至30年代中期的水平。他补充称,在非理性繁荣泡沫破灭之前,CAPE仍可能继续上升。目前的CAPE略高于1987年的水平,当时美囯股市在1987年10月19日创下了23%的最大单日跌幅。
SPDR Portfolio Aggregate Bond ETF (SPAB)
席勒对债券的担忧和对美国股市的担忧一样多。债券目前是最热门的资产类别之一,因为投资者寻求安全的收入。SPDR Portfolio Aggregate Bond ETF (SPAB)今年的总回报率与股票相当,为8.31%。这是过去10年3.7%的平均年回报率的两倍多。
债券ETF
投资者将大量资金投入债券ETF,希望避开股市波动,至少获得一些回报。“它(债券泡沫)似乎与人们没有给予足够的关注有关,通过简单的逻辑思考就能知道,这不可能继续下去,它最终会有糟糕的结局,它可能会在某个时候沉没。”
席勒说,美国房地产市场正处于泡沫阶段,与2005年没有什么不同。“这就像又回到了2005年。旧金山和洛杉矶的房市已经在放缓。”他说,这是一个“糟糕的指标”,因为这些市场多年来一直在上涨。
Real Estate Select Sector ETF, XLRE
SPDR ETF (XLK)
房地产类股也很火爆。房地产精选行业ETF (Real Estate Select Sector ETF, XLRE)仅今年就上涨了近29%,超过了标准普尔500指数20%的涨幅。房地产类股仅以微弱优势落后于科技精选板块SPDR ETF (XLK),成为今年表现最佳的板块。
OUR STOCK PORTFOLIO UPDATE | Our Dividend Income In Early Retirement (Ep. 9 - October 2019)
Here is the link.
Books that have helped us on our Financial Independence Journey ----- The Bogleheads' Guide to Investing: https://amzn.to/2UjEc4j The Intelligent Investor: https://amzn.to/2MKGokh A Random Walk Down Wall Street: https://amzn.to/2zIVI8p The Book on Rental Property Investing: https://amzn.to/2UkwgQ6 Building Wealth One House at a Time: https://amzn.to/2ZJQuDW Rich Dad Poor Dad: https://amzn.to/2ZD29IK The Total Money Makeover: https://amzn.to/2Lc0thn The $100 Startup: https://amzn.to/2UnBpqK Freakonomics: https://amzn.to/2HCnDeJ
Books that have helped us on our Financial Independence Journey ----- The Bogleheads' Guide to Investing: https://amzn.to/2UjEc4j The Intelligent Investor: https://amzn.to/2MKGokh A Random Walk Down Wall Street: https://amzn.to/2zIVI8p The Book on Rental Property Investing: https://amzn.to/2UkwgQ6 Building Wealth One House at a Time: https://amzn.to/2ZJQuDW Rich Dad Poor Dad: https://amzn.to/2ZD29IK The Total Money Makeover: https://amzn.to/2Lc0thn The $100 Startup: https://amzn.to/2UnBpqK Freakonomics: https://amzn.to/2HCnDeJ
1238. Circular Permutation in Binary Representation
Here is the discussion post.
C# Design algorithm using DFS similar to Sudoku solver
It is a medium level algorithm which can be solved using depth first search. The challenge part is to work on bit manipulation, how to change one bit from index = 0 to index = 15?
Case study:
I need to warmup bit manipulation to learn to solve two problems in the following:
I need to warmup bit manipulation to learn to solve two problems in the following:
- Change one bit - how to change it?
Use bit operator XOR. As we know, 0 ^ 0 = 0, 0 ^1 = 1, 1 ^ 1 = 0; and there are 16 bits to alter, and we can use left shift operator to generate an integer to set nth bit to 1 whereas n is from 0 to 15. In other words, I have to come out the express 1 << i.
So, the answer is last ^ (1 << i), whereas is from 0 to 15. - How to prove two numbers are the same except one bit?
Assume that m and n only have one bit different, so m ^ n = 2^p, p is from p to 15. And p & (p - 1) = 0 <=> all bits from 0 to p should be 0.
Here are highlights:
- Understand how to run DFS to search all possible paths until one path is found.
- Work on DFS search - base case, backtracking, mark visited using HashSet to avoid deadloop;
- Time complexity and space analysis is similar to my favorite algorithm Sudoku solver.
Actionable Items
I could not solve the algorithm in weekly contest 160 on Oct. 26, 2019. I spent over 20 minutes to analyze, but I could not come out using DFS algorithm to work on all bits from 0 to 15.
I have to practice more often in weekdays, solve more medium algorithms.
I could not solve the algorithm in weekly contest 160 on Oct. 26, 2019. I spent over 20 minutes to analyze, but I could not come out using DFS algorithm to work on all bits from 0 to 15.
I have to practice more often in weekdays, solve more medium algorithms.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _1238_circular_permutation
{
class Program
{
static void Main(string[] args)
{
}
/// <summary>
/// 1238 Circular Permutation in Binary Representation
/// The idea is similar to Sudoku solver; Each step using DFS to search all options.
/// </summary>
/// <param name="n"></param>
/// <param name="start"></param>
/// <returns></returns>
public IList<int> CircularPermutation(int n, int start)
{
var result = new List<int>();
var set = new HashSet<int>();
result.Add(start);
set.Add(start);
runDFS(n, set, result, start);
return result;
}
/// <summary>
/// similar to Sudoku solver
/// backtracking
/// DFS path - mark visited
/// </summary>
/// <param name="n"></param>
/// <param name="hashSet"></param>
/// <param name="result"></param>
/// <param name="start"></param>
/// <returns></returns>
private static bool runDFS(int n, HashSet<int> hashSet, IList<int> result, int start)
{
if (hashSet.Count == (int)Math.Pow(2, n))
{
int x = result[result.Count - 1] ^ start; // XOR operator - first and last are different
return (x & (x - 1)) == 0;
}
var length = result.Count;
int last = result[length - 1];
for (int i = 0; i < 16; i++)
{
int next = last ^ (1 << i); // XOR operator - change ith bit
if (next <= (Math.Pow(2, n) - 1) && !hashSet.Contains(next))
{
hashSet.Add(next);
result.Add(next);
if(runDFS(n, hashSet, result, start))
{
return true;
}
hashSet.Remove(next);
result.RemoveAt(result.Count - 1);
}
}
return false;
}
}
}
Subscribe to:
Posts (Atom)
