021.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 the first two 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 the first two lists.
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.
Given an array containing n distinct numbers taken from 0, 1, 2, …, n, find the one that is missing from the array.
For example,
Given nums = [0, 1, 3] return 2.
Note:
Your algorithm should run in linear runtime complexity. Could you implement it using only constant extra space complexity?
Design a data structure that supports the following two operations:
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.
Given a non-empty binary search tree and a target value, find the value in the BST that is closest to the target.
Given an array of integers, every element appears three times except for one. Find that single one.
Given a binary tree, return the bottom-up level order traversal of its nodes’ values. (ie, from left to right, level by level from leaf to root).
Given a binary tree, return the level order traversal of its nodes’ values. (ie, from left to right, level by level).
Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.
Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.