Skip to content

update #84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions [Q]basic/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
- because when array is full, resizing takes O(n) time

## python
# list
- list
```python
# list

Expand Down Expand Up @@ -339,7 +339,7 @@ sl = SortedList([10, 11, 12, 13, 14])
sl.bisect_left(12) # 2
```

# dict
- dict
```python
# dict

Expand Down Expand Up @@ -498,7 +498,7 @@ idx = sd.bisect_left(25)
print(idx) # 3
```

# set
- set
```python
# set

Expand Down Expand Up @@ -573,7 +573,7 @@ s3 = s1.symmetric_difference(s2)
print(s3) # {1, 2, 4, 5}
```

# tuple
- tuple
```python
# tuple

Expand All @@ -594,7 +594,7 @@ t = tuple(["a", "b", "c"]) # ('a', 'b', 'c')
t = ("abc",) # ('abc',)
```

# heap
- heap
```python
# heap

Expand Down Expand Up @@ -629,7 +629,7 @@ heapify(list2)
print(list2) # [-9, -7, -5, -1, -3]
```

# queue
- queue
```python
# queue
# in Python, list can be used as stack
Expand Down Expand Up @@ -674,7 +674,7 @@ queue2.popleft() # c
# extend() is O(k), add multiple values
```

# number
- number
```python
# number

Expand Down Expand Up @@ -962,7 +962,7 @@ print(sqrt(5)) # 2.23606797749979
print(int(sqrt(5))) # 2
```

# string
- string
```python
# string

Expand Down Expand Up @@ -1083,7 +1083,7 @@ s = '0'
s = '1' + s + '1' # '101'
```

# class
- class
```python
# class

Expand Down Expand Up @@ -1187,7 +1187,7 @@ outer()

## java

# Array
- Array
```Java
package ArraySyntax;

Expand Down Expand Up @@ -1373,7 +1373,7 @@ public class Main {

```

# ArrayList
- ArrayList
```Java
package ArrayListSyntax;

Expand Down Expand Up @@ -1559,7 +1559,7 @@ public class Main {

```

# HashMap
- HashMap
```Java
package HashMapSyntax;

Expand Down Expand Up @@ -1724,7 +1724,7 @@ public class Main {

```

# HashSet
- HashSet
```Java
package HashSetSyntax;

Expand Down Expand Up @@ -1805,7 +1805,7 @@ public class Main {

```

# PriorityQueue
- PriorityQueue
```Java
package PriorityQueueSyntax;

Expand Down Expand Up @@ -1876,7 +1876,7 @@ record FreqWord(String content, Integer freq) { }

```

# ArrayDeque
- ArrayDeque
```Java
package ArrayDequeSyntax;

Expand Down Expand Up @@ -1975,7 +1975,7 @@ record Pair(TreeNode node, int level) { };

```

# String
- String
```Java
package StringSyntax;

Expand Down Expand Up @@ -2187,7 +2187,7 @@ public class Main {

```

# TreeMap
- TreeMap
```Java
package TreeMapSyntax;

Expand Down Expand Up @@ -2327,7 +2327,7 @@ public class Main {

```

# Number
- Number
```Java
package NumberSyntax;

Expand Down