Skip to content

Commit 7103828

Browse files
author
Dominik Schauer
committed
1 concurrency and 1 shell solution respectively to have a reason to create folders
1 parent 1b02467 commit 7103828

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

concurrency/1114_Print_in_Order.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from threading import Event
2+
class Foo:
3+
def __init__(self):
4+
self.done = (Event(),Event())
5+
6+
def first(self, printFirst):
7+
printFirst()
8+
self.done[0].set()
9+
10+
def second(self, printSecond):
11+
self.done[0].wait()
12+
printSecond()
13+
self.done[1].set()
14+
15+
def third(self, printThird):
16+
self.done[1].wait()
17+
printThird()

shell/192_Word_Frequency.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
awk '
2+
{
3+
for (i = 1; i <= NF; i++)
4+
words[$i]++
5+
}
6+
7+
END {
8+
for (word in words)
9+
print word, words[word]
10+
}
11+
' words.txt | sort -n -r -k 2

0 commit comments

Comments
 (0)