zhedahht / CodingInterviewChinese2

《剑指Offer:名企面试官精讲典型编程面试题》第二版源代码
Other
5.32k stars 2.17k forks source link

memery release for bool matrix variable 'visited' #26

Open Yu-Xiaoxian opened 6 years ago

Yu-Xiaoxian commented 6 years ago

动态申请的内存空间 visited,当函数在for循环中退出时,也应该及时释放,因此在'return true'之前,添加'delete[] visited'.