Skip to content

Commit bb7f5e1

Browse files
committed
remove linter warnings
1 parent de56684 commit bb7f5e1

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.PHONY: linter
22
linter:
3-
markdownlint README.md
3+
markdownlint README.md --disable MD013
44

55
.PHONY: pdf
66
pdf:

README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Python for coding interviews
2+
23
List of several and useful `Python` data structures to know for coding interviews.
34

45
It is intended to show main data structures incorporated in the language
@@ -8,11 +9,11 @@ Information described here, can be integrated with the following list:
89

910
| **Topic** | **Link** |
1011
|---|---|
11-
| Time complexity | https://wiki.python.org/moin/TimeComplexity |
12-
| Python collections | https://docs.python.org/3/library/collections.html |
13-
12+
| Time complexity | <https://wiki.python.org/moin/TimeComplexity> |
13+
| Python collections | <https://docs.python.org/3/library/collections.html> |
1414

1515
## Primitive Types
16+
1617
1. Booleans (`bool`).
1718
1. Integers (`int`).
1819
1. Floats (`float`).
@@ -77,14 +78,14 @@ Information described here, can be integrated with the following list:
7778
inf
7879
```
7980

80-
8181
### Bit manipulation
82+
8283
```python
8384
TODO
8485
```
8586

86-
8787
## Tuples
88+
8889
```python
8990
>>> t = (1, 2, 'str')
9091
>>> type(t)
@@ -109,7 +110,9 @@ TODO
109110
```
110111

111112
## Lists
113+
112114
More info about time complexity for lists can be found [here][python-time-complexity].
115+
113116
```python
114117
>>> l = [1, 2, 'a']
115118
>>> type(l) # <class 'list'>
@@ -176,8 +179,8 @@ True
176179
True
177180
```
178181

179-
180182
## Strings
183+
181184
```python
182185
>>> s = 'Hello, world!'
183186
>>> type(s) # <class 'str'>
@@ -202,6 +205,7 @@ True
202205
```
203206

204207
## Stacks
208+
205209
```python
206210
>>> stack = []
207211

@@ -232,8 +236,8 @@ True
232236
>>> stack[-1] # `IndexError: pop from empty list`
233237
```
234238

235-
236239
## Queues
240+
237241
```python
238242
>>> from collections import deque
239243

@@ -271,8 +275,8 @@ True
271275
>>> queue[0] # `IndexError: pop from an empty deque`
272276
```
273277

274-
275278
## Sets
279+
276280
```python
277281
>>> s = set()
278282
>>> s.add(1)
@@ -325,8 +329,8 @@ True
325329
{2}
326330
```
327331

328-
329332
## Hash Tables
333+
330334
```python
331335
>>> d = {'a': 'hello, world', b: 11}
332336
>>> type(d)
@@ -364,18 +368,18 @@ False
364368
'a new element'
365369
```
366370

367-
368371
## Heaps
372+
369373
The following commands show how to work with a min heap.
370374
Currently, Python does not have public methods for the max heap.
371375
You can overcome this problem by applying one of the following strategies:
376+
372377
1. Invert the value of each number. So, for example, if you want to add
373378
1, 2 and 3 in the min heap, you can `heappush` -3, -2 and -1.
374379
When you `heappop` you invert the number again to get the proper value.
375380
This solution clearly works if your domain is composed by numbers &ge; 0.
376381
1. [Invert your object comparison](https://stackoverflow.com/a/40455775).
377382

378-
379383
```python
380384
>>> import heapq
381385

@@ -406,17 +410,13 @@ You can overcome this problem by applying one of the following strategies:
406410
>>> heapq.heappop(min_heap) # `IndexError: index out of range`
407411
```
408412

409-
410413
## Searching
414+
411415
```python
412416
```
413417

418+
### collections.namedtuple
414419

415-
## collections
416-
More information about container datatypes can be found
417-
in [the official documentation][python-collections].
418-
419-
### namedtuple
420420
```python
421421
>>> from collections import namedtuple
422422

@@ -448,8 +448,8 @@ True
448448
True
449449
```
450450

451+
### collections.defaultdict
451452

452-
### defaultdict
453453
```python
454454
>>> from collections import defaultdict
455455

@@ -471,8 +471,8 @@ defaultdict(<class 'int'>, {'x': 3, 'y': 10})
471471
defaultdict(<class 'list'>, {'x': [1, 2]})
472472
```
473473

474+
### collections.Counter
474475

475-
### Counter
476476
```python
477477
>>> from collections import Counter
478478

@@ -493,8 +493,8 @@ c 2
493493
0
494494
```
495495

496+
### collections.OrderedDict
496497

497-
### OrderedDict
498498
```python
499499
>>> from collections import OrderedDict
500500

0 commit comments

Comments
 (0)