摘要:
Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must close in the correct ... 阅读全文
摘要:
Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephon... 阅读全文
摘要:
Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete a... 阅读全文
摘要:
Say you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted to complete at most one transaction (ie... 阅读全文
摘要:
第一节 Floyd-Warshall算法本算法可以求任意两个点之间的最短路径,又称“多源最短路径”,其时间复杂度为O(n^3)其核心部分只有下面几行,注意加法的溢出处理 //floyd最短路径算法的核心部分 for(int k = 0; k grid[i][k]+grid[k][j])... 阅读全文