算法总结
作者:
LeoFranz | 来源:发表于
2019-08-23 15:36 被阅读0次
Array
- 寻址困难:hash table reduces the look up time to O(1),需要保存键* 值对时候采用HashTable
- 去除重复项目:先排序,然后通过辅助数组,或者数组前后元素对比
- 求最大值得问题:动态规划,使用max和currentMax
- 倒着对比??
LinkedList
java 是提莫的值传递
public void deleteNode(ListNode node) {
node = node.next;// the LinkedList does not change at all!
}
public void deleteNode(ListNode node) {
node.val = node.next.val;
node.next = node.next.next;
}// we should do this instead
本文标题:算法总结
本文链接:https://www.haomeiwen.com/subject/qmqtectx.html
网友评论