11 2018 档案
摘要:示例无向图如下:(起始点为v0) 邻接矩阵为: 注意:其中没有连接的边和自己到自己的点权值用10000表示。 代码: 结果 解析: 分三部分,主函数中给出图中的初始邻接矩阵,顶点个数。以及初始化最短路径的顶点集合和点路线集合。 IsContain(int m,int[] S)这个函数是在每次循环的时
阅读全文
摘要:26、Remove Duplicates from Sorted Array Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return th
阅读全文
摘要:21、 Merge Two Sorted Lists Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of th
阅读全文
摘要:20、Valid Parentheses Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input s
阅读全文
摘要:14、Longest Common Prefix Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return a
阅读全文
摘要:13、Roman to Integer Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. For example, two is written as II in Roman nume
阅读全文
摘要:9、Palindrome Number Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. Example 1: Ex
阅读全文
摘要:7、Reverse Integer Given a 32-bit signed integer, reverse digits of an integer. Example 1: Example 2: Example 3: 解析: 输入:整数 输出:整数 代码思想: 首先,对非0整数从个位数开始向左
阅读全文
摘要:1、Two Sum Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input wou
阅读全文


浙公网安备 33010602011771号