Description
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).
For example, this binary tree [1,2,2,3,4,4,3]
is symmetric:
1 | 1 |
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).
For example, this binary tree [1,2,2,3,4,4,3]
is symmetric:
1 | 1 |
Given two binary trees, write a function to check if they are the same or not.
Two binary trees are considered the same if they are structurally identical and the nodes have the same value.
Given two binary strings, return their sum (also a binary string).
The input strings are both non-empty and contains only characters 1
or 0
.
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.
You may assume no duplicates in the array.
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.
Example:
1 | Input: 1->2->4, 1->3->4 |
Given a string containing just the characters '('
, ')'
, '{'
, '}'
, '['
and ']'
, determine if the input string is valid.
An input string is valid if:
Note that an empty string is also considered valid.
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 would have exactly one solution, and you may not use the same element twice.
Mac Book Pro (MBP)一直是极客开发者首选的操作系统,然而在工作中,并不是每个公司都会为开发者配备 MBP 的,然而,相信有强迫症的程序员都无法忍受 Windows 的命令行工具,我也不例外。好再微软在 2019 年 5 月推出了一款 Windows Terminal(截至作者撰稿时,仅 Preview 版可用),可以说给基于 Window 开发的程序员带来了福音。
项目开发时,调用第三方服务集群,集群有多台机器,当机器之间没有主从之分时,需要应用层自己做负载均衡以保证各机器之间的流量均衡。
分布式系统中,常用负载调度算法有轮询、加权轮询、哈希、随机、加权随机、最小连接数。