Develop a calculator that can compute numbers beyond the limitations of built-in data types.
Implement a program to calculate expressions. It should include:
- Arithmetic operators: +, -, *, /, % (Note: '/' denotes integer division, i.e., a/b =
$\lfloor\frac{a}{b}\rfloor$ ) - Parentheses: (, )
- Example: For an input like
1+2=*5+(1+7+11)=%5-11=
, the program should output the correct result.
Utilize Doubly Linked List and XOR linked list to address the given problem.
Implement data structures to support reverse operation of the linked list in O(1) time complexity. Additionally, ensure that traversal order adheres to the problem requirements.
- Initial approach: Use a special pointer (super_link) to meet the problem's demands, ensuring efficient and elegant code.
Give a string and add the minimum number of characters to convert it into a palindrome.
- Find the longest palindrome on the left and right sides.
Example: Input: "aabc", Left: "aa" -> 2, Right: "c" -> 1
- Use a method similar to the KMP string matching algorithm. Build a KMP table bidirectionally.
- Determine the longest palindrome side, then reflect the string on that side without duplicating the palindrome.
- Disjoint Set
- Offline algorithm
- Array operations and challenges (Detailed in HW4.pdf).
- Record data offline to backtrack to a specific day.
- Implement a segment tree and treap (min heap + binary tree).
- Apply a lazy tag for efficient updates.(吉如一線段樹)
- Reference: Implicit Treap Implementation
- Note: The uploaded code contains some bugs.