Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. The function ...
分类:
其他好文 时间:
2018-10-14 17:46:26
阅读次数:
134
Description For this problem, you will write a program that reads in a sequence of 32-bit signed integers. After each odd-indexed value is read, outpu ...
分类:
其他好文 时间:
2018-10-14 17:45:02
阅读次数:
164
Given a linked list, swap every two adjacent nodes and return its head. Example: Given 1 2 3 4, you should return the list as 2 1 4 3. Note: Your algo ...
分类:
其他好文 时间:
2018-10-14 14:15:45
阅读次数:
119
题目 Given two strings s and t , write a function to determine if t is an anagram of s. Example 1: Input: s = "anagram", t = "nagaram" Output: true Exam ...
分类:
其他好文 时间:
2018-10-14 14:14:27
阅读次数:
133
题目 Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and t ...
分类:
其他好文 时间:
2018-10-14 14:13:21
阅读次数:
145
Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of s is a ...
分类:
其他好文 时间:
2018-10-14 14:05:13
阅读次数:
139
题目 Given an integer, write a function to determine if it is a power of two. Example 1: Input: 1 Output: true Explanation: 20 = 1 Example 2: Input: 16 ...
分类:
其他好文 时间:
2018-10-14 13:49:06
阅读次数:
197
第二次过程性考核 码云地址:https://gite.com/yzyal/16012103_ai_lu_assessment_two 定义一个有关人的Person类,内含属性:String name、int age、boolean gender、int id,所有的变量必须为私有(private)。 ...
分类:
其他好文 时间:
2018-10-14 01:52:12
阅读次数:
146
一、题目 1、审题 2、分析 给出两个单向链表,如果两个链表用重叠部分,输出重叠节点的第一个节点,否则输出 null; 二、解答 1、思路: 方法一、 将两个链表按照尾部进行对齐,在开始遍历链表,查找是否存在重叠节点。 ①、计算两个链表长度; ②、将长的链表向后移动,使得两链表尾部对齐; ③、开始查 ...
分类:
其他好文 时间:
2018-10-13 19:48:15
阅读次数:
173
问题描述 给定一个整数数组, 返回两个数字的索引, 使两个数字相加为到特定值。 您可以假设每个输入都有一个解决方案, 并且您不能使用相同的元素两次。 方法 1: 蛮力 蛮力方法很简单。循环遍历每个元素 xx 并查找是否有另一个值等于目标 xtarget?x。 方法2: 哈希表 为了提高运行时速度, ...
分类:
编程语言 时间:
2018-10-13 14:43:54
阅读次数:
145