Julia samples (#108)
* Add julialang binary search sample * Add unit test * Add julialang selection sort sample * Change julia suffix to jl * Add recursion and quick sort with tests * add quick sort * Add hash table samples * Add BFS * Changed file names * Add dijkstras * Add Dijkstras test
This commit is contained in:
committed by
Aditya Bhargava
parent
30bbe9cf01
commit
9dc7611411
2
05_hash_tables/julia/01_price_of_groceries.jl
Normal file
2
05_hash_tables/julia/01_price_of_groceries.jl
Normal file
@@ -0,0 +1,2 @@
|
||||
book = Dict("apple"=> 0.67, "milk"=> 1.49, "avocado"=> 1.49)
|
||||
println(book)
|
||||
13
05_hash_tables/julia/02_check_voter.jl
Normal file
13
05_hash_tables/julia/02_check_voter.jl
Normal file
@@ -0,0 +1,13 @@
|
||||
function check_vote(name)
|
||||
if voted.get(name)
|
||||
println("kick them out!")
|
||||
else
|
||||
voted[name] = true
|
||||
println("let them vote!")
|
||||
end
|
||||
end
|
||||
|
||||
voted = Dict()
|
||||
check_vote("tom")
|
||||
check_vote("mike")
|
||||
check_vote("mike")
|
||||
Reference in New Issue
Block a user