摘要:
题目: Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are+,-,*,/. Each operand may be an integer or another e 阅读全文
摘要:
题目描述 Determine whether an integer is a palindrome. Do this without extra space. click to show spoilers. Some hints: Could negative integers be palindr 阅读全文
摘要:
(解二最优,我现在能写的最好的了) 题目: Say you have an array for which the i th element is the price of a given stock on day i. If you were only permitted to complete 阅读全文
摘要:
题目: Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. 解题: 想了半天的辣鸡代码: 阅读全文
摘要:
Say you have an array for which the i th element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may compl 阅读全文
摘要:
hashmap就是一个链表散列,上边是table 下边是链表,可以理解为数组链表 键值对都可以为null 默认的hashmap大小为16,实际可以存储的只有16*0.72个, 一旦超过这个值就会进行hashmap扩容,扩容的方式是size*2,即按照2次方进行自动扩容,扩容时会进行resize,重新 阅读全文
摘要:
有些时候使用数组代替栈,玩意数组容量不够需要扩容 则: 1.Array.toString();直接遍历打印数组 2.数组扩容采用Array.copyOf(),直接实现数组扩容功能,非常强大 (实际上,由于数组一旦实例化以后就不能改变其大小,因此需要创建一个更大的数组,并把旧数组的内容放到新数组中) 阅读全文
摘要:
package com.nps.base.xue.DataStructure.stack.utils; import java.util.Scanner; import java.util.Stack; /* * @author XueWeiWei * @date 2019/7/7 9:02 */ public class PostfixEvaluator { private ... 阅读全文