摘要: 中英题面 给定两个二叉树,写一个函数来检查它们是否相同。 Given two binary trees, write a function to check if they are the same or not. 如果两棵树在结构上相同并且节点具有相同的值,则认为它们是相同的。 Two binar 阅读全文
posted @ 2018-04-05 17:06 Efve 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 中英题面 你正在爬楼梯。距离顶部还有 n 台阶。 You are climbing a stair case. It takes n steps to reach to the top. 每次你可以爬 1 或 2 个台阶。你有多少种不同的方式可以爬到楼顶呢? Each time you can ei 阅读全文
posted @ 2018-04-05 16:54 Efve 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 中英题面 给定一个排序数组和一个目标值,如果在数组中找到目标值则返回索引。如果没有,返回到它将会被按顺序插入的位置。 Given a sorted array and a target value, return the index if the target is found. If not, r 阅读全文
posted @ 2018-04-05 14:52 Efve 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 中英题面 Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 合并两 阅读全文
posted @ 2018-04-05 14:36 Efve 阅读(217) 评论(0) 推荐(0) 编辑
摘要: 中英题面 给定一个链表,删除链表的倒数第 n 个节点并返回头结点。 Given a linked list, remove the nth node from the end of list and return its head. 例如, For example, 说明: 给的 n 始终是有效的。 阅读全文
posted @ 2018-04-05 14:22 Efve 阅读(1039) 评论(0) 推荐(0) 编辑