摘要: Given a sorted linked list, delete all duplicates such that each element appear only once. Example 1: Input: 1 1 2 Output: 1 2 Example 2: Input: 1 1 2 阅读全文
posted @ 2018-11-06 15:52 bernieloveslife 阅读(92) 评论(0) 推荐(0)
摘要: Given an integer, write an algorithm to convert it to hexadecimal. For negative integer, two’s complement method is used. Note: All letters in hexadec 阅读全文
posted @ 2018-11-06 15:52 bernieloveslife 阅读(126) 评论(0) 推荐(0)
摘要: Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According to the definition of LCA on Wikipedia: “The lowes 阅读全文
posted @ 2018-11-06 15:52 bernieloveslife 阅读(108) 评论(0) 推荐(0)
摘要: Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wikipedia 阅读全文
posted @ 2018-11-06 15:52 bernieloveslife 阅读(94) 评论(0) 推荐(0)
摘要: Given two non negative integers num1 and num2 represented as string, return the sum of num1 and num2. Note: 1. The length of both num1 and num2 is 9: 阅读全文
posted @ 2018-11-06 15:52 bernieloveslife 阅读(154) 评论(0) 推荐(0)