diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
deleted file mode 100644
index 507caa8..0000000
--- a/.github/FUNDING.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-# These are supported funding model platforms
-
-custom: paypal.me/miasteinkirch
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 2eff776..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,20 +0,0 @@
-*.py[cod]
-*~
-
-# C extensions
-*.so
-
-# Installer logs
-pip-log.txt
-
-# Unit test / coverage reports
-.coverage
-.tox
-nosetests.xml
-
-# Translations
-*.mo
-
-
-# PyCharm
-.idea
\ No newline at end of file
diff --git a/First_edition_2014/README.md b/First_edition_2014/README.md
deleted file mode 100644
index eb1e807..0000000
--- a/First_edition_2014/README.md
+++ /dev/null
@@ -1,15 +0,0 @@
-## Python, Algorithms and Data Structures (2014)
-
-[Download PDF (first edition,published by Hanbit Media)](https://github.com/bt3gl/Python-and-Algorithms-and-Data-Structures/blob/master/First_edition_2014/ebook_pdf/book_second_edition.pdf).
-
-
-## To run the snippet:
-
-Install dependencies in a [virtual environment](https://coderwall.com/p/8-aeka):
-
-```
-virtualenv venv
-source venv/bin/activate
-pip install -r requirements.txt
-```
-
diff --git a/First_edition_2014/ebook_src/trees/__init__.py b/First_edition_2014/ebook_src/trees/__init__.py
deleted file mode 100755
index e69de29..0000000
diff --git a/First_edition_2014/requirements.txt b/First_edition_2014/requirements.txt
deleted file mode 100644
index 69a3f35..0000000
--- a/First_edition_2014/requirements.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-Flask==1.0
-SQLAlchemy==0.9.7
-bpython==0.13.1
-coverage==3.7.1
-curtsies==0.0.34
-graphviz==0.4.2
-ipython==0.13.2
-matplotlib==1.3.1
-nose==1.3.0
-numpy==1.8.2
-scapy==2.4.1
-scikit-learn==0.14.1
-scipy==0.12.1
\ No newline at end of file
diff --git a/MY_BOOK/600_stars.png b/MY_BOOK/600_stars.png
new file mode 100644
index 0000000..ca4a6bb
Binary files /dev/null and b/MY_BOOK/600_stars.png differ
diff --git a/First_edition_2014/ebook_pdf/book_second_edition.pdf b/MY_BOOK/ebook_pdf/book_second_edition.pdf
similarity index 100%
rename from First_edition_2014/ebook_pdf/book_second_edition.pdf
rename to MY_BOOK/ebook_pdf/book_second_edition.pdf
diff --git a/First_edition_2014/ebook_src/abstract_structures/HashTable.py b/MY_BOOK/ebook_src/abstract_structures/HashTableClass.py
similarity index 100%
rename from First_edition_2014/ebook_src/abstract_structures/HashTable.py
rename to MY_BOOK/ebook_src/abstract_structures/HashTableClass.py
diff --git a/First_edition_2014/ebook_src/abstract_structures/Queue.py b/MY_BOOK/ebook_src/abstract_structures/QueueClass.py
similarity index 100%
rename from First_edition_2014/ebook_src/abstract_structures/Queue.py
rename to MY_BOOK/ebook_src/abstract_structures/QueueClass.py
diff --git a/First_edition_2014/ebook_src/abstract_structures/Stack.py b/MY_BOOK/ebook_src/abstract_structures/Stack.py
similarity index 100%
rename from First_edition_2014/ebook_src/abstract_structures/Stack.py
rename to MY_BOOK/ebook_src/abstract_structures/Stack.py
diff --git a/First_edition_2014/ebook_src/abstract_structures/__init__.py b/MY_BOOK/ebook_src/abstract_structures/__init__.py
similarity index 100%
rename from First_edition_2014/ebook_src/abstract_structures/__init__.py
rename to MY_BOOK/ebook_src/abstract_structures/__init__.py
diff --git a/First_edition_2014/ebook_src/USEFUL/dynamic_programming/__init__.py b/MY_BOOK/ebook_src/abstract_structures/heap/__init__.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/dynamic_programming/__init__.py
rename to MY_BOOK/ebook_src/abstract_structures/heap/__init__.py
diff --git a/First_edition_2014/ebook_src/abstract_structures/heap/find_N_largest_smallest_items_seq.py b/MY_BOOK/ebook_src/abstract_structures/heap/find_N_largest_smallest_items_seq.py
similarity index 100%
rename from First_edition_2014/ebook_src/abstract_structures/heap/find_N_largest_smallest_items_seq.py
rename to MY_BOOK/ebook_src/abstract_structures/heap/find_N_largest_smallest_items_seq.py
diff --git a/First_edition_2014/ebook_src/abstract_structures/heap/heapify.py b/MY_BOOK/ebook_src/abstract_structures/heap/heapify.py
similarity index 100%
rename from First_edition_2014/ebook_src/abstract_structures/heap/heapify.py
rename to MY_BOOK/ebook_src/abstract_structures/heap/heapify.py
diff --git a/First_edition_2014/ebook_src/abstract_structures/heap/merge_sorted_seqs.py b/MY_BOOK/ebook_src/abstract_structures/heap/merge_sorted_seqs.py
similarity index 100%
rename from First_edition_2014/ebook_src/abstract_structures/heap/merge_sorted_seqs.py
rename to MY_BOOK/ebook_src/abstract_structures/heap/merge_sorted_seqs.py
diff --git a/First_edition_2014/ebook_src/abstract_structures/heap/priority_queue.py b/MY_BOOK/ebook_src/abstract_structures/heap/priority_queue.py
similarity index 100%
rename from First_edition_2014/ebook_src/abstract_structures/heap/priority_queue.py
rename to MY_BOOK/ebook_src/abstract_structures/heap/priority_queue.py
diff --git a/First_edition_2014/ebook_src/USEFUL/oop/__init__.py b/MY_BOOK/ebook_src/abstract_structures/linked_list/__init__.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/oop/__init__.py
rename to MY_BOOK/ebook_src/abstract_structures/linked_list/__init__.py
diff --git a/First_edition_2014/ebook_src/abstract_structures/linked_list/circular_ll.py b/MY_BOOK/ebook_src/abstract_structures/linked_list/circular_ll.py
similarity index 100%
rename from First_edition_2014/ebook_src/abstract_structures/linked_list/circular_ll.py
rename to MY_BOOK/ebook_src/abstract_structures/linked_list/circular_ll.py
diff --git a/First_edition_2014/ebook_src/abstract_structures/linked_list/double_linked_list_fifo.py b/MY_BOOK/ebook_src/abstract_structures/linked_list/double_linked_list_fifo.py
similarity index 100%
rename from First_edition_2014/ebook_src/abstract_structures/linked_list/double_linked_list_fifo.py
rename to MY_BOOK/ebook_src/abstract_structures/linked_list/double_linked_list_fifo.py
diff --git a/First_edition_2014/ebook_src/abstract_structures/linked_list/find_kth_from_the_end.py b/MY_BOOK/ebook_src/abstract_structures/linked_list/find_kth_from_the_end.py
similarity index 100%
rename from First_edition_2014/ebook_src/abstract_structures/linked_list/find_kth_from_the_end.py
rename to MY_BOOK/ebook_src/abstract_structures/linked_list/find_kth_from_the_end.py
diff --git a/First_edition_2014/ebook_src/abstract_structures/linked_list/linked_list_fifo.py b/MY_BOOK/ebook_src/abstract_structures/linked_list/linked_list_fifo.py
similarity index 100%
rename from First_edition_2014/ebook_src/abstract_structures/linked_list/linked_list_fifo.py
rename to MY_BOOK/ebook_src/abstract_structures/linked_list/linked_list_fifo.py
diff --git a/First_edition_2014/ebook_src/abstract_structures/linked_list/linked_list_lifo.py b/MY_BOOK/ebook_src/abstract_structures/linked_list/linked_list_lifo.py
similarity index 100%
rename from First_edition_2014/ebook_src/abstract_structures/linked_list/linked_list_lifo.py
rename to MY_BOOK/ebook_src/abstract_structures/linked_list/linked_list_lifo.py
diff --git a/First_edition_2014/ebook_src/abstract_structures/linked_list/node.py b/MY_BOOK/ebook_src/abstract_structures/linked_list/node.py
similarity index 100%
rename from First_edition_2014/ebook_src/abstract_structures/linked_list/node.py
rename to MY_BOOK/ebook_src/abstract_structures/linked_list/node.py
diff --git a/First_edition_2014/ebook_src/abstract_structures/linked_list/part_linked_list.py b/MY_BOOK/ebook_src/abstract_structures/linked_list/part_linked_list.py
similarity index 100%
rename from First_edition_2014/ebook_src/abstract_structures/linked_list/part_linked_list.py
rename to MY_BOOK/ebook_src/abstract_structures/linked_list/part_linked_list.py
diff --git a/First_edition_2014/ebook_src/abstract_structures/linked_list/sum_linked_list.py b/MY_BOOK/ebook_src/abstract_structures/linked_list/sum_linked_list.py
similarity index 100%
rename from First_edition_2014/ebook_src/abstract_structures/linked_list/sum_linked_list.py
rename to MY_BOOK/ebook_src/abstract_structures/linked_list/sum_linked_list.py
diff --git a/First_edition_2014/ebook_src/abstract_structures/heap/__init__.py b/MY_BOOK/ebook_src/abstract_structures/queues/__init__.py
similarity index 100%
rename from First_edition_2014/ebook_src/abstract_structures/heap/__init__.py
rename to MY_BOOK/ebook_src/abstract_structures/queues/__init__.py
diff --git a/First_edition_2014/ebook_src/abstract_structures/queues/animal_shelter.py b/MY_BOOK/ebook_src/abstract_structures/queues/animal_shelter.py
similarity index 100%
rename from First_edition_2014/ebook_src/abstract_structures/queues/animal_shelter.py
rename to MY_BOOK/ebook_src/abstract_structures/queues/animal_shelter.py
diff --git a/First_edition_2014/ebook_src/abstract_structures/queues/deque.py b/MY_BOOK/ebook_src/abstract_structures/queues/deque.py
similarity index 100%
rename from First_edition_2014/ebook_src/abstract_structures/queues/deque.py
rename to MY_BOOK/ebook_src/abstract_structures/queues/deque.py
diff --git a/First_edition_2014/ebook_src/abstract_structures/queues/linked_queue.py b/MY_BOOK/ebook_src/abstract_structures/queues/linked_queue.py
similarity index 100%
rename from First_edition_2014/ebook_src/abstract_structures/queues/linked_queue.py
rename to MY_BOOK/ebook_src/abstract_structures/queues/linked_queue.py
diff --git a/First_edition_2014/ebook_src/abstract_structures/queues/palindrome_checker_with_deque.py b/MY_BOOK/ebook_src/abstract_structures/queues/palindrome_checker_with_deque.py
similarity index 100%
rename from First_edition_2014/ebook_src/abstract_structures/queues/palindrome_checker_with_deque.py
rename to MY_BOOK/ebook_src/abstract_structures/queues/palindrome_checker_with_deque.py
diff --git a/First_edition_2014/ebook_src/abstract_structures/queues/queue.py b/MY_BOOK/ebook_src/abstract_structures/queues/queue.py
similarity index 100%
rename from First_edition_2014/ebook_src/abstract_structures/queues/queue.py
rename to MY_BOOK/ebook_src/abstract_structures/queues/queue.py
diff --git a/First_edition_2014/ebook_src/abstract_structures/linked_list/__init__.py b/MY_BOOK/ebook_src/abstract_structures/stacks/__init__.py
similarity index 100%
rename from First_edition_2014/ebook_src/abstract_structures/linked_list/__init__.py
rename to MY_BOOK/ebook_src/abstract_structures/stacks/__init__.py
diff --git a/First_edition_2014/ebook_src/abstract_structures/stacks/dec2bin_with_stack.py b/MY_BOOK/ebook_src/abstract_structures/stacks/dec2bin_with_stack.py
similarity index 100%
rename from First_edition_2014/ebook_src/abstract_structures/stacks/dec2bin_with_stack.py
rename to MY_BOOK/ebook_src/abstract_structures/stacks/dec2bin_with_stack.py
diff --git a/First_edition_2014/ebook_src/abstract_structures/stacks/linked_stack.py b/MY_BOOK/ebook_src/abstract_structures/stacks/linked_stack.py
similarity index 100%
rename from First_edition_2014/ebook_src/abstract_structures/stacks/linked_stack.py
rename to MY_BOOK/ebook_src/abstract_structures/stacks/linked_stack.py
diff --git a/First_edition_2014/ebook_src/abstract_structures/stacks/reverse_string_with_stack.py b/MY_BOOK/ebook_src/abstract_structures/stacks/reverse_string_with_stack.py
similarity index 100%
rename from First_edition_2014/ebook_src/abstract_structures/stacks/reverse_string_with_stack.py
rename to MY_BOOK/ebook_src/abstract_structures/stacks/reverse_string_with_stack.py
diff --git a/First_edition_2014/ebook_src/abstract_structures/stacks/set_of_stacks.py b/MY_BOOK/ebook_src/abstract_structures/stacks/set_of_stacks.py
similarity index 100%
rename from First_edition_2014/ebook_src/abstract_structures/stacks/set_of_stacks.py
rename to MY_BOOK/ebook_src/abstract_structures/stacks/set_of_stacks.py
diff --git a/First_edition_2014/ebook_src/abstract_structures/stacks/stack.py b/MY_BOOK/ebook_src/abstract_structures/stacks/stack.py
similarity index 100%
rename from First_edition_2014/ebook_src/abstract_structures/stacks/stack.py
rename to MY_BOOK/ebook_src/abstract_structures/stacks/stack.py
diff --git a/First_edition_2014/ebook_src/abstract_structures/stacks/stack_with_min.py b/MY_BOOK/ebook_src/abstract_structures/stacks/stack_with_min.py
similarity index 100%
rename from First_edition_2014/ebook_src/abstract_structures/stacks/stack_with_min.py
rename to MY_BOOK/ebook_src/abstract_structures/stacks/stack_with_min.py
diff --git a/First_edition_2014/ebook_src/abstract_structures/stacks/towers_of_hanoi.py b/MY_BOOK/ebook_src/abstract_structures/stacks/towers_of_hanoi.py
similarity index 100%
rename from First_edition_2014/ebook_src/abstract_structures/stacks/towers_of_hanoi.py
rename to MY_BOOK/ebook_src/abstract_structures/stacks/towers_of_hanoi.py
diff --git a/First_edition_2014/ebook_src/bitwise/bit_array.py b/MY_BOOK/ebook_src/bitwise_operations/bit_array.py
similarity index 100%
rename from First_edition_2014/ebook_src/bitwise/bit_array.py
rename to MY_BOOK/ebook_src/bitwise_operations/bit_array.py
diff --git a/First_edition_2014/ebook_src/bitwise/bitwise.txt b/MY_BOOK/ebook_src/bitwise_operations/bitwise.txt
similarity index 100%
rename from First_edition_2014/ebook_src/bitwise/bitwise.txt
rename to MY_BOOK/ebook_src/bitwise_operations/bitwise.txt
diff --git a/First_edition_2014/ebook_src/bitwise/clear_bits.py b/MY_BOOK/ebook_src/bitwise_operations/clear_bits.py
similarity index 100%
rename from First_edition_2014/ebook_src/bitwise/clear_bits.py
rename to MY_BOOK/ebook_src/bitwise_operations/clear_bits.py
diff --git a/First_edition_2014/ebook_src/bitwise/find_bit_len.py b/MY_BOOK/ebook_src/bitwise_operations/find_bit_len.py
similarity index 100%
rename from First_edition_2014/ebook_src/bitwise/find_bit_len.py
rename to MY_BOOK/ebook_src/bitwise_operations/find_bit_len.py
diff --git a/First_edition_2014/ebook_src/bitwise/find_how_many_1_binary.py b/MY_BOOK/ebook_src/bitwise_operations/find_how_many_1_binary.py
similarity index 100%
rename from First_edition_2014/ebook_src/bitwise/find_how_many_1_binary.py
rename to MY_BOOK/ebook_src/bitwise_operations/find_how_many_1_binary.py
diff --git a/First_edition_2014/ebook_src/bitwise/get_bit.py b/MY_BOOK/ebook_src/bitwise_operations/get_bit.py
similarity index 100%
rename from First_edition_2014/ebook_src/bitwise/get_bit.py
rename to MY_BOOK/ebook_src/bitwise_operations/get_bit.py
diff --git a/First_edition_2014/ebook_src/bitwise/get_float_rep_bin.py b/MY_BOOK/ebook_src/bitwise_operations/get_float_rep_bin.py
similarity index 100%
rename from First_edition_2014/ebook_src/bitwise/get_float_rep_bin.py
rename to MY_BOOK/ebook_src/bitwise_operations/get_float_rep_bin.py
diff --git a/First_edition_2014/ebook_src/bitwise/insert_small_bin_into_big_bin.py b/MY_BOOK/ebook_src/bitwise_operations/insert_small_bin_into_big_bin.py
similarity index 100%
rename from First_edition_2014/ebook_src/bitwise/insert_small_bin_into_big_bin.py
rename to MY_BOOK/ebook_src/bitwise_operations/insert_small_bin_into_big_bin.py
diff --git a/First_edition_2014/ebook_src/bitwise/next_with_same_num_1s.py b/MY_BOOK/ebook_src/bitwise_operations/next_with_same_num_1s.py
similarity index 100%
rename from First_edition_2014/ebook_src/bitwise/next_with_same_num_1s.py
rename to MY_BOOK/ebook_src/bitwise_operations/next_with_same_num_1s.py
diff --git a/First_edition_2014/ebook_src/bitwise/num_bits_to_convert_2_nums.py b/MY_BOOK/ebook_src/bitwise_operations/num_bits_to_convert_2_nums.py
similarity index 100%
rename from First_edition_2014/ebook_src/bitwise/num_bits_to_convert_2_nums.py
rename to MY_BOOK/ebook_src/bitwise_operations/num_bits_to_convert_2_nums.py
diff --git a/First_edition_2014/ebook_src/bitwise/set_bit.py b/MY_BOOK/ebook_src/bitwise_operations/set_bit.py
similarity index 100%
rename from First_edition_2014/ebook_src/bitwise/set_bit.py
rename to MY_BOOK/ebook_src/bitwise_operations/set_bit.py
diff --git a/First_edition_2014/ebook_src/bitwise/swap_in_place.py b/MY_BOOK/ebook_src/bitwise_operations/swap_in_place.py
similarity index 100%
rename from First_edition_2014/ebook_src/bitwise/swap_in_place.py
rename to MY_BOOK/ebook_src/bitwise_operations/swap_in_place.py
diff --git a/First_edition_2014/ebook_src/bitwise/swap_odd_even.py b/MY_BOOK/ebook_src/bitwise_operations/swap_odd_even.py
similarity index 100%
rename from First_edition_2014/ebook_src/bitwise/swap_odd_even.py
rename to MY_BOOK/ebook_src/bitwise_operations/swap_odd_even.py
diff --git a/First_edition_2014/ebook_src/bitwise/update_bit.py b/MY_BOOK/ebook_src/bitwise_operations/update_bit.py
similarity index 100%
rename from First_edition_2014/ebook_src/bitwise/update_bit.py
rename to MY_BOOK/ebook_src/bitwise_operations/update_bit.py
diff --git a/First_edition_2014/ebook_src/abstract_structures/queues/__init__.py b/MY_BOOK/ebook_src/builtin_structures/__init__.py
old mode 100644
new mode 100755
similarity index 100%
rename from First_edition_2014/ebook_src/abstract_structures/queues/__init__.py
rename to MY_BOOK/ebook_src/builtin_structures/__init__.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/anagram.py b/MY_BOOK/ebook_src/builtin_structures/anagram.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/anagram.py
rename to MY_BOOK/ebook_src/builtin_structures/anagram.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/balance.txt b/MY_BOOK/ebook_src/builtin_structures/balance.txt
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/balance.txt
rename to MY_BOOK/ebook_src/builtin_structures/balance.txt
diff --git a/First_edition_2014/ebook_src/builtin_structures/balance_symbols.py b/MY_BOOK/ebook_src/builtin_structures/balance_symbols.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/balance_symbols.py
rename to MY_BOOK/ebook_src/builtin_structures/balance_symbols.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/check_if_2_numbers_sum_to_k.py b/MY_BOOK/ebook_src/builtin_structures/check_if_2_numbers_sum_to_k.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/check_if_2_numbers_sum_to_k.py
rename to MY_BOOK/ebook_src/builtin_structures/check_if_2_numbers_sum_to_k.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/check_if_3_numbers_sum_to_zero.py b/MY_BOOK/ebook_src/builtin_structures/check_if_3_numbers_sum_to_zero.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/check_if_3_numbers_sum_to_zero.py
rename to MY_BOOK/ebook_src/builtin_structures/check_if_3_numbers_sum_to_zero.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/check_non_overlapping_intervals.py b/MY_BOOK/ebook_src/builtin_structures/check_non_overlapping_intervals.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/check_non_overlapping_intervals.py
rename to MY_BOOK/ebook_src/builtin_structures/check_non_overlapping_intervals.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/convert_numerical_bases.py b/MY_BOOK/ebook_src/builtin_structures/convert_numerical_bases.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/convert_numerical_bases.py
rename to MY_BOOK/ebook_src/builtin_structures/convert_numerical_bases.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/convert_str_2_int.py b/MY_BOOK/ebook_src/builtin_structures/convert_str_2_int.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/convert_str_2_int.py
rename to MY_BOOK/ebook_src/builtin_structures/convert_str_2_int.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/count_unique_words_On2.py b/MY_BOOK/ebook_src/builtin_structures/count_unique_words_On2.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/count_unique_words_On2.py
rename to MY_BOOK/ebook_src/builtin_structures/count_unique_words_On2.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/delete_duplicate_char_str.py b/MY_BOOK/ebook_src/builtin_structures/delete_duplicate_char_str.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/delete_duplicate_char_str.py
rename to MY_BOOK/ebook_src/builtin_structures/delete_duplicate_char_str.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/fibonacci.py b/MY_BOOK/ebook_src/builtin_structures/fibonacci.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/fibonacci.py
rename to MY_BOOK/ebook_src/builtin_structures/fibonacci.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/find_0_MxN_replace_cols_rows.py b/MY_BOOK/ebook_src/builtin_structures/find_0_MxN_replace_cols_rows.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/find_0_MxN_replace_cols_rows.py
rename to MY_BOOK/ebook_src/builtin_structures/find_0_MxN_replace_cols_rows.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/find_dice_probabilities.py b/MY_BOOK/ebook_src/builtin_structures/find_dice_probabilities.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/find_dice_probabilities.py
rename to MY_BOOK/ebook_src/builtin_structures/find_dice_probabilities.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/find_edit_distance.py b/MY_BOOK/ebook_src/builtin_structures/find_edit_distance.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/find_edit_distance.py
rename to MY_BOOK/ebook_src/builtin_structures/find_edit_distance.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/find_first_non_repetead_char.py b/MY_BOOK/ebook_src/builtin_structures/find_first_non_repetead_char.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/find_first_non_repetead_char.py
rename to MY_BOOK/ebook_src/builtin_structures/find_first_non_repetead_char.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/find_gcd.py b/MY_BOOK/ebook_src/builtin_structures/find_gcd.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/find_gcd.py
rename to MY_BOOK/ebook_src/builtin_structures/find_gcd.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/find_if_substr.py b/MY_BOOK/ebook_src/builtin_structures/find_if_substr.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/find_if_substr.py
rename to MY_BOOK/ebook_src/builtin_structures/find_if_substr.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/find_if_unique_char.py b/MY_BOOK/ebook_src/builtin_structures/find_if_unique_char.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/find_if_unique_char.py
rename to MY_BOOK/ebook_src/builtin_structures/find_if_unique_char.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/find_largest_sum.py b/MY_BOOK/ebook_src/builtin_structures/find_largest_sum.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/find_largest_sum.py
rename to MY_BOOK/ebook_src/builtin_structures/find_largest_sum.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/find_longest_inc_subseq.py b/MY_BOOK/ebook_src/builtin_structures/find_longest_inc_subseq.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/find_longest_inc_subseq.py
rename to MY_BOOK/ebook_src/builtin_structures/find_longest_inc_subseq.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/find_longest_str_unique_chars.py b/MY_BOOK/ebook_src/builtin_structures/find_longest_str_unique_chars.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/find_longest_str_unique_chars.py
rename to MY_BOOK/ebook_src/builtin_structures/find_longest_str_unique_chars.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/find_non_repeating_number.py b/MY_BOOK/ebook_src/builtin_structures/find_non_repeating_number.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/find_non_repeating_number.py
rename to MY_BOOK/ebook_src/builtin_structures/find_non_repeating_number.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/find_product_without_division.py b/MY_BOOK/ebook_src/builtin_structures/find_product_without_division.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/find_product_without_division.py
rename to MY_BOOK/ebook_src/builtin_structures/find_product_without_division.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/find_top_N_recurring_words.py b/MY_BOOK/ebook_src/builtin_structures/find_top_N_recurring_words.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/find_top_N_recurring_words.py
rename to MY_BOOK/ebook_src/builtin_structures/find_top_N_recurring_words.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/find_two_missing_numbers_in_sequence.py b/MY_BOOK/ebook_src/builtin_structures/find_two_missing_numbers_in_sequence.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/find_two_missing_numbers_in_sequence.py
rename to MY_BOOK/ebook_src/builtin_structures/find_two_missing_numbers_in_sequence.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/get_float_rep_bin.py b/MY_BOOK/ebook_src/builtin_structures/get_float_rep_bin.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/get_float_rep_bin.py
rename to MY_BOOK/ebook_src/builtin_structures/get_float_rep_bin.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/interserction_two_arrays.py b/MY_BOOK/ebook_src/builtin_structures/interserction_two_arrays.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/interserction_two_arrays.py
rename to MY_BOOK/ebook_src/builtin_structures/interserction_two_arrays.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/max_subarray_stocks.py b/MY_BOOK/ebook_src/builtin_structures/max_subarray_stocks.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/max_subarray_stocks.py
rename to MY_BOOK/ebook_src/builtin_structures/max_subarray_stocks.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/number_of_zeros_factorial.txt b/MY_BOOK/ebook_src/builtin_structures/number_of_zeros_factorial.txt
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/number_of_zeros_factorial.txt
rename to MY_BOOK/ebook_src/builtin_structures/number_of_zeros_factorial.txt
diff --git a/First_edition_2014/ebook_src/builtin_structures/palindrome.py b/MY_BOOK/ebook_src/builtin_structures/palindrome.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/palindrome.py
rename to MY_BOOK/ebook_src/builtin_structures/palindrome.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/permutations.py b/MY_BOOK/ebook_src/builtin_structures/permutations.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/permutations.py
rename to MY_BOOK/ebook_src/builtin_structures/permutations.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/permutations_alphanumeric.py b/MY_BOOK/ebook_src/builtin_structures/permutations_alphanumeric.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/permutations_alphanumeric.py
rename to MY_BOOK/ebook_src/builtin_structures/permutations_alphanumeric.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/primes.py b/MY_BOOK/ebook_src/builtin_structures/primes.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/primes.py
rename to MY_BOOK/ebook_src/builtin_structures/primes.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/prod_other_ints.py b/MY_BOOK/ebook_src/builtin_structures/prod_other_ints.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/prod_other_ints.py
rename to MY_BOOK/ebook_src/builtin_structures/prod_other_ints.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/ransom_note.py b/MY_BOOK/ebook_src/builtin_structures/ransom_note.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/ransom_note.py
rename to MY_BOOK/ebook_src/builtin_structures/ransom_note.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/reverse_string.py b/MY_BOOK/ebook_src/builtin_structures/reverse_string.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/reverse_string.py
rename to MY_BOOK/ebook_src/builtin_structures/reverse_string.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/reverse_words.py b/MY_BOOK/ebook_src/builtin_structures/reverse_words.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/reverse_words.py
rename to MY_BOOK/ebook_src/builtin_structures/reverse_words.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/rotate_NxN.py b/MY_BOOK/ebook_src/builtin_structures/rotate_NxN.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/rotate_NxN.py
rename to MY_BOOK/ebook_src/builtin_structures/rotate_NxN.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/runtime_dicts_with_timeit_module.py b/MY_BOOK/ebook_src/builtin_structures/runtime_dicts_with_timeit_module.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/runtime_dicts_with_timeit_module.py
rename to MY_BOOK/ebook_src/builtin_structures/runtime_dicts_with_timeit_module.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/runtime_lists_with_timeit_module.py b/MY_BOOK/ebook_src/builtin_structures/runtime_lists_with_timeit_module.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/runtime_lists_with_timeit_module.py
rename to MY_BOOK/ebook_src/builtin_structures/runtime_lists_with_timeit_module.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/search_entry_matrix.py b/MY_BOOK/ebook_src/builtin_structures/search_entry_matrix.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/search_entry_matrix.py
rename to MY_BOOK/ebook_src/builtin_structures/search_entry_matrix.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/simple_str_comprension.py b/MY_BOOK/ebook_src/builtin_structures/simple_str_comprension.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/simple_str_comprension.py
rename to MY_BOOK/ebook_src/builtin_structures/simple_str_comprension.py
diff --git a/First_edition_2014/ebook_src/builtin_structures/sum_two_numbers_as_strings.py b/MY_BOOK/ebook_src/builtin_structures/sum_two_numbers_as_strings.py
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/sum_two_numbers_as_strings.py
rename to MY_BOOK/ebook_src/builtin_structures/sum_two_numbers_as_strings.py
diff --git a/First_edition_2014/ebook_src/abstract_structures/stacks/__init__.py b/MY_BOOK/ebook_src/dynamic_programming/__init__.py
similarity index 100%
rename from First_edition_2014/ebook_src/abstract_structures/stacks/__init__.py
rename to MY_BOOK/ebook_src/dynamic_programming/__init__.py
diff --git a/First_edition_2014/ebook_src/USEFUL/dynamic_programming/memo.py b/MY_BOOK/ebook_src/dynamic_programming/memo.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/dynamic_programming/memo.py
rename to MY_BOOK/ebook_src/dynamic_programming/memo.py
diff --git a/First_edition_2014/ebook_src/USEFUL/dynamic_programming/memoized_longest_inc_subseq.py b/MY_BOOK/ebook_src/dynamic_programming/memoized_longest_inc_subseq.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/dynamic_programming/memoized_longest_inc_subseq.py
rename to MY_BOOK/ebook_src/dynamic_programming/memoized_longest_inc_subseq.py
diff --git a/First_edition_2014/ebook_src/USEFUL/useful_with_files/change_ext_file.py b/MY_BOOK/ebook_src/manipulating_files/change_ext_file.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/useful_with_files/change_ext_file.py
rename to MY_BOOK/ebook_src/manipulating_files/change_ext_file.py
diff --git a/First_edition_2014/ebook_src/USEFUL/useful_with_files/count_unique_words_files.py b/MY_BOOK/ebook_src/manipulating_files/count_unique_words_files.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/useful_with_files/count_unique_words_files.py
rename to MY_BOOK/ebook_src/manipulating_files/count_unique_words_files.py
diff --git a/First_edition_2014/ebook_src/USEFUL/useful_with_files/count_unique_words_frequency.py b/MY_BOOK/ebook_src/manipulating_files/count_unique_words_frequency.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/useful_with_files/count_unique_words_frequency.py
rename to MY_BOOK/ebook_src/manipulating_files/count_unique_words_frequency.py
diff --git a/First_edition_2014/ebook_src/USEFUL/useful_with_files/grep_word_from_files.py b/MY_BOOK/ebook_src/manipulating_files/grep_word_from_files.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/useful_with_files/grep_word_from_files.py
rename to MY_BOOK/ebook_src/manipulating_files/grep_word_from_files.py
diff --git a/First_edition_2014/ebook_src/USEFUL/useful_with_files/remove_blank_lines.py b/MY_BOOK/ebook_src/manipulating_files/remove_blank_lines.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/useful_with_files/remove_blank_lines.py
rename to MY_BOOK/ebook_src/manipulating_files/remove_blank_lines.py
diff --git a/First_edition_2014/ebook_src/USEFUL/basic_examples/example_OrderedDict.py b/MY_BOOK/ebook_src/python_examples/example_OrderedDict.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/basic_examples/example_OrderedDict.py
rename to MY_BOOK/ebook_src/python_examples/example_OrderedDict.py
diff --git a/First_edition_2014/ebook_src/USEFUL/basic_examples/example_args.py b/MY_BOOK/ebook_src/python_examples/example_args.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/basic_examples/example_args.py
rename to MY_BOOK/ebook_src/python_examples/example_args.py
diff --git a/First_edition_2014/ebook_src/USEFUL/basic_examples/example_benchmark_decorator.py b/MY_BOOK/ebook_src/python_examples/example_benchmark_decorator.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/basic_examples/example_benchmark_decorator.py
rename to MY_BOOK/ebook_src/python_examples/example_benchmark_decorator.py
diff --git a/First_edition_2014/ebook_src/USEFUL/oop/ShapeClass.py b/MY_BOOK/ebook_src/python_examples/example_class.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/oop/ShapeClass.py
rename to MY_BOOK/ebook_src/python_examples/example_class.py
diff --git a/First_edition_2014/ebook_src/USEFUL/basic_examples/example_comp_lists.py b/MY_BOOK/ebook_src/python_examples/example_comp_lists.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/basic_examples/example_comp_lists.py
rename to MY_BOOK/ebook_src/python_examples/example_comp_lists.py
diff --git a/First_edition_2014/ebook_src/USEFUL/basic_examples/example_counter.py b/MY_BOOK/ebook_src/python_examples/example_counter.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/basic_examples/example_counter.py
rename to MY_BOOK/ebook_src/python_examples/example_counter.py
diff --git a/First_edition_2014/ebook_src/learning/decorator.py b/MY_BOOK/ebook_src/python_examples/example_decorator.py
similarity index 100%
rename from First_edition_2014/ebook_src/learning/decorator.py
rename to MY_BOOK/ebook_src/python_examples/example_decorator.py
diff --git a/First_edition_2014/ebook_src/USEFUL/basic_examples/example_decorators.py b/MY_BOOK/ebook_src/python_examples/example_decorators.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/basic_examples/example_decorators.py
rename to MY_BOOK/ebook_src/python_examples/example_decorators.py
diff --git a/First_edition_2014/ebook_src/USEFUL/basic_examples/example_defaultdict.py b/MY_BOOK/ebook_src/python_examples/example_defaultdict.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/basic_examples/example_defaultdict.py
rename to MY_BOOK/ebook_src/python_examples/example_defaultdict.py
diff --git a/First_edition_2014/ebook_src/USEFUL/basic_examples/example_doctest.py b/MY_BOOK/ebook_src/python_examples/example_doctest.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/basic_examples/example_doctest.py
rename to MY_BOOK/ebook_src/python_examples/example_doctest.py
diff --git a/First_edition_2014/ebook_src/USEFUL/basic_examples/example_fractions.py b/MY_BOOK/ebook_src/python_examples/example_fractions.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/basic_examples/example_fractions.py
rename to MY_BOOK/ebook_src/python_examples/example_fractions.py
diff --git a/First_edition_2014/ebook_src/USEFUL/basic_examples/example_generator.py b/MY_BOOK/ebook_src/python_examples/example_generator.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/basic_examples/example_generator.py
rename to MY_BOOK/ebook_src/python_examples/example_generator.py
diff --git a/First_edition_2014/ebook_src/USEFUL/basic_examples/example_lambda.py b/MY_BOOK/ebook_src/python_examples/example_lambda.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/basic_examples/example_lambda.py
rename to MY_BOOK/ebook_src/python_examples/example_lambda.py
diff --git a/First_edition_2014/ebook_src/USEFUL/basic_examples/example_logging.py b/MY_BOOK/ebook_src/python_examples/example_logging.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/basic_examples/example_logging.py
rename to MY_BOOK/ebook_src/python_examples/example_logging.py
diff --git a/First_edition_2014/ebook_src/USEFUL/advanced/lru_cache.py b/MY_BOOK/ebook_src/python_examples/example_lru_cache.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/advanced/lru_cache.py
rename to MY_BOOK/ebook_src/python_examples/example_lru_cache.py
diff --git a/First_edition_2014/ebook_src/USEFUL/basic_examples/example_numpy.py b/MY_BOOK/ebook_src/python_examples/example_numpy.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/basic_examples/example_numpy.py
rename to MY_BOOK/ebook_src/python_examples/example_numpy.py
diff --git a/First_edition_2014/ebook_src/USEFUL/basic_examples/example_open_files.py b/MY_BOOK/ebook_src/python_examples/example_open_files.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/basic_examples/example_open_files.py
rename to MY_BOOK/ebook_src/python_examples/example_open_files.py
diff --git a/First_edition_2014/ebook_src/USEFUL/basic_examples/example_pickle.py b/MY_BOOK/ebook_src/python_examples/example_pickle.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/basic_examples/example_pickle.py
rename to MY_BOOK/ebook_src/python_examples/example_pickle.py
diff --git a/First_edition_2014/ebook_src/USEFUL/basic_examples/example_queue.py b/MY_BOOK/ebook_src/python_examples/example_queue.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/basic_examples/example_queue.py
rename to MY_BOOK/ebook_src/python_examples/example_queue.py
diff --git a/First_edition_2014/ebook_src/USEFUL/basic_examples/example_random.py b/MY_BOOK/ebook_src/python_examples/example_random.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/basic_examples/example_random.py
rename to MY_BOOK/ebook_src/python_examples/example_random.py
diff --git a/First_edition_2014/ebook_src/USEFUL/basic_examples/example_setdefault.py b/MY_BOOK/ebook_src/python_examples/example_setdefault.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/basic_examples/example_setdefault.py
rename to MY_BOOK/ebook_src/python_examples/example_setdefault.py
diff --git a/First_edition_2014/ebook_src/USEFUL/basic_examples/example_sets.py b/MY_BOOK/ebook_src/python_examples/example_sets.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/basic_examples/example_sets.py
rename to MY_BOOK/ebook_src/python_examples/example_sets.py
diff --git a/First_edition_2014/ebook_src/USEFUL/basic_examples/example_socket.py b/MY_BOOK/ebook_src/python_examples/example_socket.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/basic_examples/example_socket.py
rename to MY_BOOK/ebook_src/python_examples/example_socket.py
diff --git a/First_edition_2014/ebook_src/USEFUL/basic_examples/example_string_format.py b/MY_BOOK/ebook_src/python_examples/example_string_format.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/basic_examples/example_string_format.py
rename to MY_BOOK/ebook_src/python_examples/example_string_format.py
diff --git a/First_edition_2014/ebook_src/USEFUL/basic_examples/example_subprocess.py b/MY_BOOK/ebook_src/python_examples/example_subprocess.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/basic_examples/example_subprocess.py
rename to MY_BOOK/ebook_src/python_examples/example_subprocess.py
diff --git a/First_edition_2014/ebook_src/USEFUL/basic_examples/example_telnet.py b/MY_BOOK/ebook_src/python_examples/example_telnet.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/basic_examples/example_telnet.py
rename to MY_BOOK/ebook_src/python_examples/example_telnet.py
diff --git a/First_edition_2014/ebook_src/USEFUL/basic_examples/example_testing.py b/MY_BOOK/ebook_src/python_examples/example_testing.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/basic_examples/example_testing.py
rename to MY_BOOK/ebook_src/python_examples/example_testing.py
diff --git a/First_edition_2014/ebook_src/USEFUL/basic_examples/example_threads.py b/MY_BOOK/ebook_src/python_examples/example_threads.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/basic_examples/example_threads.py
rename to MY_BOOK/ebook_src/python_examples/example_threads.py
diff --git a/First_edition_2014/ebook_src/USEFUL/basic_examples/example_time.py b/MY_BOOK/ebook_src/python_examples/example_time.py
similarity index 100%
rename from First_edition_2014/ebook_src/USEFUL/basic_examples/example_time.py
rename to MY_BOOK/ebook_src/python_examples/example_time.py
diff --git a/First_edition_2014/ebook_src/real_interview_problems/2n_packets.py b/MY_BOOK/ebook_src/real_interview_problems/2n_packets.py
similarity index 100%
rename from First_edition_2014/ebook_src/real_interview_problems/2n_packets.py
rename to MY_BOOK/ebook_src/real_interview_problems/2n_packets.py
diff --git a/First_edition_2014/ebook_src/real_interview_problems/balanced.py b/MY_BOOK/ebook_src/real_interview_problems/balanced.py
similarity index 100%
rename from First_edition_2014/ebook_src/real_interview_problems/balanced.py
rename to MY_BOOK/ebook_src/real_interview_problems/balanced.py
diff --git a/First_edition_2014/ebook_src/real_interview_problems/binary_search.py b/MY_BOOK/ebook_src/real_interview_problems/binary_search.py
similarity index 100%
rename from First_edition_2014/ebook_src/real_interview_problems/binary_search.py
rename to MY_BOOK/ebook_src/real_interview_problems/binary_search.py
diff --git a/First_edition_2014/ebook_src/real_interview_problems/bst.py b/MY_BOOK/ebook_src/real_interview_problems/bst.py
similarity index 100%
rename from First_edition_2014/ebook_src/real_interview_problems/bst.py
rename to MY_BOOK/ebook_src/real_interview_problems/bst.py
diff --git a/First_edition_2014/ebook_src/real_interview_problems/check_anagram.py b/MY_BOOK/ebook_src/real_interview_problems/check_anagram.py
similarity index 100%
rename from First_edition_2014/ebook_src/real_interview_problems/check_anagram.py
rename to MY_BOOK/ebook_src/real_interview_problems/check_anagram.py
diff --git a/First_edition_2014/ebook_src/real_interview_problems/combination.py b/MY_BOOK/ebook_src/real_interview_problems/combination.py
similarity index 100%
rename from First_edition_2014/ebook_src/real_interview_problems/combination.py
rename to MY_BOOK/ebook_src/real_interview_problems/combination.py
diff --git a/First_edition_2014/ebook_src/real_interview_problems/hash_table.py b/MY_BOOK/ebook_src/real_interview_problems/hash_table.py
similarity index 100%
rename from First_edition_2014/ebook_src/real_interview_problems/hash_table.py
rename to MY_BOOK/ebook_src/real_interview_problems/hash_table.py
diff --git a/First_edition_2014/ebook_src/real_interview_problems/linked_list.py b/MY_BOOK/ebook_src/real_interview_problems/linked_list.py
similarity index 100%
rename from First_edition_2014/ebook_src/real_interview_problems/linked_list.py
rename to MY_BOOK/ebook_src/real_interview_problems/linked_list.py
diff --git a/First_edition_2014/ebook_src/real_interview_problems/longest_common_prefix.py b/MY_BOOK/ebook_src/real_interview_problems/longest_common_prefix.py
similarity index 100%
rename from First_edition_2014/ebook_src/real_interview_problems/longest_common_prefix.py
rename to MY_BOOK/ebook_src/real_interview_problems/longest_common_prefix.py
diff --git a/First_edition_2014/ebook_src/real_interview_problems/longest_increasing_subsequence.py b/MY_BOOK/ebook_src/real_interview_problems/longest_increasing_subsequence.py
similarity index 100%
rename from First_edition_2014/ebook_src/real_interview_problems/longest_increasing_subsequence.py
rename to MY_BOOK/ebook_src/real_interview_problems/longest_increasing_subsequence.py
diff --git a/First_edition_2014/ebook_src/real_interview_problems/merge_sort.py b/MY_BOOK/ebook_src/real_interview_problems/merge_sort.py
similarity index 100%
rename from First_edition_2014/ebook_src/real_interview_problems/merge_sort.py
rename to MY_BOOK/ebook_src/real_interview_problems/merge_sort.py
diff --git a/First_edition_2014/other_resources/PYTHON.md b/MY_BOOK/ebook_src/real_interview_problems/other_resources/PYTHON.md
similarity index 100%
rename from First_edition_2014/other_resources/PYTHON.md
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/PYTHON.md
diff --git a/First_edition_2014/other_resources/Project-Euler/.gitignore b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/.gitignore
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/.gitignore
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/.gitignore
diff --git a/First_edition_2014/other_resources/Project-Euler/001-multiples_of_3_and_5.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/001-multiples_of_3_and_5.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/001-multiples_of_3_and_5.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/001-multiples_of_3_and_5.py
diff --git a/First_edition_2014/other_resources/Project-Euler/002-even_fib_num.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/002-even_fib_num.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/002-even_fib_num.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/002-even_fib_num.py
diff --git a/First_edition_2014/other_resources/Project-Euler/003-largest_prime_factor.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/003-largest_prime_factor.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/003-largest_prime_factor.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/003-largest_prime_factor.py
diff --git a/First_edition_2014/other_resources/Project-Euler/004-larg_palindrome.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/004-larg_palindrome.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/004-larg_palindrome.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/004-larg_palindrome.py
diff --git a/First_edition_2014/other_resources/Project-Euler/005-smallest_multiple.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/005-smallest_multiple.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/005-smallest_multiple.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/005-smallest_multiple.py
diff --git a/First_edition_2014/other_resources/Project-Euler/006-sum_square_diff.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/006-sum_square_diff.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/006-sum_square_diff.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/006-sum_square_diff.py
diff --git a/First_edition_2014/other_resources/Project-Euler/007-findstprime.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/007-findstprime.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/007-findstprime.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/007-findstprime.py
diff --git a/First_edition_2014/other_resources/Project-Euler/008-largest_product_seq.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/008-largest_product_seq.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/008-largest_product_seq.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/008-largest_product_seq.py
diff --git a/First_edition_2014/other_resources/Project-Euler/009-special_pyt.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/009-special_pyt.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/009-special_pyt.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/009-special_pyt.py
diff --git a/First_edition_2014/other_resources/Project-Euler/010-summation_primes.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/010-summation_primes.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/010-summation_primes.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/010-summation_primes.py
diff --git a/First_edition_2014/other_resources/Project-Euler/011-larg_prod_grid.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/011-larg_prod_grid.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/011-larg_prod_grid.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/011-larg_prod_grid.py
diff --git a/First_edition_2014/other_resources/Project-Euler/012-highly_divisible_trian_num.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/012-highly_divisible_trian_num.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/012-highly_divisible_trian_num.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/012-highly_divisible_trian_num.py
diff --git a/First_edition_2014/other_resources/Project-Euler/013-large_sum.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/013-large_sum.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/013-large_sum.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/013-large_sum.py
diff --git a/First_edition_2014/other_resources/Project-Euler/014-long_collatz_seq.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/014-long_collatz_seq.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/014-long_collatz_seq.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/014-long_collatz_seq.py
diff --git a/First_edition_2014/other_resources/Project-Euler/015-lattice_paths.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/015-lattice_paths.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/015-lattice_paths.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/015-lattice_paths.py
diff --git a/First_edition_2014/other_resources/Project-Euler/016-power_digit_sum.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/016-power_digit_sum.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/016-power_digit_sum.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/016-power_digit_sum.py
diff --git a/First_edition_2014/other_resources/Project-Euler/017-number_letter_counts.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/017-number_letter_counts.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/017-number_letter_counts.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/017-number_letter_counts.py
diff --git a/First_edition_2014/other_resources/Project-Euler/018-max_path_sum.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/018-max_path_sum.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/018-max_path_sum.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/018-max_path_sum.py
diff --git a/First_edition_2014/other_resources/Project-Euler/019-counting_sundays.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/019-counting_sundays.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/019-counting_sundays.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/019-counting_sundays.py
diff --git a/First_edition_2014/other_resources/Project-Euler/020-factorial.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/020-factorial.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/020-factorial.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/020-factorial.py
diff --git a/First_edition_2014/other_resources/Project-Euler/021-amicable_numbers.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/021-amicable_numbers.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/021-amicable_numbers.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/021-amicable_numbers.py
diff --git a/First_edition_2014/other_resources/Project-Euler/022-names_score.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/022-names_score.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/022-names_score.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/022-names_score.py
diff --git a/First_edition_2014/other_resources/Project-Euler/023-non_abund_sums.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/023-non_abund_sums.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/023-non_abund_sums.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/023-non_abund_sums.py
diff --git a/First_edition_2014/other_resources/Project-Euler/024-lexico_per.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/024-lexico_per.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/024-lexico_per.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/024-lexico_per.py
diff --git a/First_edition_2014/other_resources/Project-Euler/025-100-digit-fib.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/025-100-digit-fib.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/025-100-digit-fib.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/025-100-digit-fib.py
diff --git a/First_edition_2014/other_resources/Project-Euler/026-reciprocal-cycles.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/026-reciprocal-cycles.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/026-reciprocal-cycles.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/026-reciprocal-cycles.py
diff --git a/First_edition_2014/other_resources/Project-Euler/027-quad_primes.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/027-quad_primes.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/027-quad_primes.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/027-quad_primes.py
diff --git a/First_edition_2014/other_resources/Project-Euler/028-number_spiral.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/028-number_spiral.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/028-number_spiral.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/028-number_spiral.py
diff --git a/First_edition_2014/other_resources/Project-Euler/029-dist_pow.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/029-dist_pow.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/029-dist_pow.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/029-dist_pow.py
diff --git a/First_edition_2014/other_resources/Project-Euler/030-digit_fifth_pow.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/030-digit_fifth_pow.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/030-digit_fifth_pow.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/030-digit_fifth_pow.py
diff --git a/First_edition_2014/other_resources/Project-Euler/031-coin_sums.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/031-coin_sums.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/031-coin_sums.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/031-coin_sums.py
diff --git a/First_edition_2014/other_resources/Project-Euler/032-pandigital.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/032-pandigital.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/032-pandigital.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/032-pandigital.py
diff --git a/First_edition_2014/other_resources/Project-Euler/035-circular_primes.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/035-circular_primes.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/035-circular_primes.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/035-circular_primes.py
diff --git a/First_edition_2014/other_resources/Project-Euler/046-gold_other.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/046-gold_other.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/046-gold_other.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/046-gold_other.py
diff --git a/First_edition_2014/other_resources/Project-Euler/048-self_powers.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/048-self_powers.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/048-self_powers.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/048-self_powers.py
diff --git a/First_edition_2014/other_resources/Project-Euler/065-100th-e-numerator.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/065-100th-e-numerator.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/065-100th-e-numerator.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/065-100th-e-numerator.py
diff --git a/First_edition_2014/other_resources/Project-Euler/089-roman_numbers.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/089-roman_numbers.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/089-roman_numbers.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/089-roman_numbers.py
diff --git a/First_edition_2014/other_resources/Project-Euler/092-square_dig_chains.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/092-square_dig_chains.py
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/092-square_dig_chains.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/092-square_dig_chains.py
diff --git a/First_edition_2014/other_resources/Project-Euler/LICENSE b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/LICENSE
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/LICENSE
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/LICENSE
diff --git a/First_edition_2014/other_resources/Project-Euler/README.md b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/README.md
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/README.md
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/README.md
diff --git a/First_edition_2014/other_resources/Project-Euler/larg_prod_grid.dat b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/larg_prod_grid.dat
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/larg_prod_grid.dat
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/larg_prod_grid.dat
diff --git a/First_edition_2014/other_resources/Project-Euler/large_sum.dat b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/large_sum.dat
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/large_sum.dat
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/large_sum.dat
diff --git a/First_edition_2014/other_resources/Project-Euler/max_path_sum.dat b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/max_path_sum.dat
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/max_path_sum.dat
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/max_path_sum.dat
diff --git a/First_edition_2014/other_resources/Project-Euler/max_path_sum0.dat b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/max_path_sum0.dat
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/max_path_sum0.dat
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/max_path_sum0.dat
diff --git a/First_edition_2014/other_resources/Project-Euler/names.txt b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/names.txt
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/names.txt
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/names.txt
diff --git a/First_edition_2014/other_resources/Project-Euler/roman.txt b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/roman.txt
similarity index 100%
rename from First_edition_2014/other_resources/Project-Euler/roman.txt
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Project-Euler/roman.txt
diff --git a/First_edition_2014/other_resources/Top-Coder/.gitignore b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Top-Coder/.gitignore
similarity index 100%
rename from First_edition_2014/other_resources/Top-Coder/.gitignore
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Top-Coder/.gitignore
diff --git a/First_edition_2014/other_resources/Top-Coder/2013/tco2013_round3_3b_div1.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Top-Coder/2013/tco2013_round3_3b_div1.py
similarity index 100%
rename from First_edition_2014/other_resources/Top-Coder/2013/tco2013_round3_3b_div1.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Top-Coder/2013/tco2013_round3_3b_div1.py
diff --git a/First_edition_2014/other_resources/Top-Coder/README.md b/MY_BOOK/ebook_src/real_interview_problems/other_resources/Top-Coder/README.md
similarity index 100%
rename from First_edition_2014/other_resources/Top-Coder/README.md
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/Top-Coder/README.md
diff --git a/First_edition_2014/other_resources/eudyptula-challenge-solutions/.gitignore b/MY_BOOK/ebook_src/real_interview_problems/other_resources/eudyptula-challenge-solutions/.gitignore
similarity index 100%
rename from First_edition_2014/other_resources/eudyptula-challenge-solutions/.gitignore
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/eudyptula-challenge-solutions/.gitignore
diff --git a/First_edition_2014/other_resources/eudyptula-challenge-solutions/LICENSE b/MY_BOOK/ebook_src/real_interview_problems/other_resources/eudyptula-challenge-solutions/LICENSE
similarity index 100%
rename from First_edition_2014/other_resources/eudyptula-challenge-solutions/LICENSE
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/eudyptula-challenge-solutions/LICENSE
diff --git a/First_edition_2014/other_resources/eudyptula-challenge-solutions/bt3/.DS_Store b/MY_BOOK/ebook_src/real_interview_problems/other_resources/eudyptula-challenge-solutions/bt3/.DS_Store
similarity index 100%
rename from First_edition_2014/other_resources/eudyptula-challenge-solutions/bt3/.DS_Store
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/eudyptula-challenge-solutions/bt3/.DS_Store
diff --git a/First_edition_2014/other_resources/eudyptula-challenge-solutions/bt3/task_01/Makefile b/MY_BOOK/ebook_src/real_interview_problems/other_resources/eudyptula-challenge-solutions/bt3/task_01/Makefile
similarity index 100%
rename from First_edition_2014/other_resources/eudyptula-challenge-solutions/bt3/task_01/Makefile
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/eudyptula-challenge-solutions/bt3/task_01/Makefile
diff --git a/First_edition_2014/other_resources/eudyptula-challenge-solutions/bt3/task_01/eudyptula_1.c b/MY_BOOK/ebook_src/real_interview_problems/other_resources/eudyptula-challenge-solutions/bt3/task_01/eudyptula_1.c
similarity index 100%
rename from First_edition_2014/other_resources/eudyptula-challenge-solutions/bt3/task_01/eudyptula_1.c
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/eudyptula-challenge-solutions/bt3/task_01/eudyptula_1.c
diff --git a/First_edition_2014/other_resources/eudyptula-challenge-solutions/bt3/task_01/useful_commands b/MY_BOOK/ebook_src/real_interview_problems/other_resources/eudyptula-challenge-solutions/bt3/task_01/useful_commands
similarity index 100%
rename from First_edition_2014/other_resources/eudyptula-challenge-solutions/bt3/task_01/useful_commands
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/eudyptula-challenge-solutions/bt3/task_01/useful_commands
diff --git a/First_edition_2014/other_resources/eudyptula-challenge-solutions/bt3/task_02/Screen Shot 2017-04-24 at 11.13.33 AM.png b/MY_BOOK/ebook_src/real_interview_problems/other_resources/eudyptula-challenge-solutions/bt3/task_02/Screen Shot 2017-04-24 at 11.13.33 AM.png
similarity index 100%
rename from First_edition_2014/other_resources/eudyptula-challenge-solutions/bt3/task_02/Screen Shot 2017-04-24 at 11.13.33 AM.png
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/eudyptula-challenge-solutions/bt3/task_02/Screen Shot 2017-04-24 at 11.13.33 AM.png
diff --git a/First_edition_2014/other_resources/eudyptula-challenge-solutions/bt3/task_02/config b/MY_BOOK/ebook_src/real_interview_problems/other_resources/eudyptula-challenge-solutions/bt3/task_02/config
similarity index 100%
rename from First_edition_2014/other_resources/eudyptula-challenge-solutions/bt3/task_02/config
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/eudyptula-challenge-solutions/bt3/task_02/config
diff --git a/First_edition_2014/other_resources/eudyptula-challenge-solutions/bt3/task_02/instructions.md b/MY_BOOK/ebook_src/real_interview_problems/other_resources/eudyptula-challenge-solutions/bt3/task_02/instructions.md
similarity index 100%
rename from First_edition_2014/other_resources/eudyptula-challenge-solutions/bt3/task_02/instructions.md
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/eudyptula-challenge-solutions/bt3/task_02/instructions.md
diff --git a/First_edition_2014/other_resources/eudyptula-challenge-solutions/bt3/task_02/readme.md b/MY_BOOK/ebook_src/real_interview_problems/other_resources/eudyptula-challenge-solutions/bt3/task_02/readme.md
similarity index 100%
rename from First_edition_2014/other_resources/eudyptula-challenge-solutions/bt3/task_02/readme.md
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/eudyptula-challenge-solutions/bt3/task_02/readme.md
diff --git a/First_edition_2014/other_resources/eudyptula-challenge-solutions/kiwiz/task_01/Makefile b/MY_BOOK/ebook_src/real_interview_problems/other_resources/eudyptula-challenge-solutions/kiwiz/task_01/Makefile
similarity index 100%
rename from First_edition_2014/other_resources/eudyptula-challenge-solutions/kiwiz/task_01/Makefile
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/eudyptula-challenge-solutions/kiwiz/task_01/Makefile
diff --git a/First_edition_2014/other_resources/eudyptula-challenge-solutions/kiwiz/task_01/task-01.c b/MY_BOOK/ebook_src/real_interview_problems/other_resources/eudyptula-challenge-solutions/kiwiz/task_01/task-01.c
similarity index 100%
rename from First_edition_2014/other_resources/eudyptula-challenge-solutions/kiwiz/task_01/task-01.c
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/eudyptula-challenge-solutions/kiwiz/task_01/task-01.c
diff --git a/First_edition_2014/other_resources/eudyptula-challenge-solutions/kiwiz/task_02/.config b/MY_BOOK/ebook_src/real_interview_problems/other_resources/eudyptula-challenge-solutions/kiwiz/task_02/.config
similarity index 100%
rename from First_edition_2014/other_resources/eudyptula-challenge-solutions/kiwiz/task_02/.config
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/eudyptula-challenge-solutions/kiwiz/task_02/.config
diff --git a/First_edition_2014/other_resources/eudyptula-challenge-solutions/kiwiz/task_02/README.md b/MY_BOOK/ebook_src/real_interview_problems/other_resources/eudyptula-challenge-solutions/kiwiz/task_02/README.md
similarity index 100%
rename from First_edition_2014/other_resources/eudyptula-challenge-solutions/kiwiz/task_02/README.md
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/eudyptula-challenge-solutions/kiwiz/task_02/README.md
diff --git a/First_edition_2014/other_resources/eudyptula-challenge-solutions/kiwiz/task_03/Makefile b/MY_BOOK/ebook_src/real_interview_problems/other_resources/eudyptula-challenge-solutions/kiwiz/task_03/Makefile
similarity index 100%
rename from First_edition_2014/other_resources/eudyptula-challenge-solutions/kiwiz/task_03/Makefile
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/eudyptula-challenge-solutions/kiwiz/task_03/Makefile
diff --git a/First_edition_2014/other_resources/eudyptula-challenge-solutions/kiwiz/task_03/README.md b/MY_BOOK/ebook_src/real_interview_problems/other_resources/eudyptula-challenge-solutions/kiwiz/task_03/README.md
similarity index 100%
rename from First_edition_2014/other_resources/eudyptula-challenge-solutions/kiwiz/task_03/README.md
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/eudyptula-challenge-solutions/kiwiz/task_03/README.md
diff --git a/First_edition_2014/other_resources/eudyptula-challenge-solutions/useful_scripts/sending_mutt.sh b/MY_BOOK/ebook_src/real_interview_problems/other_resources/eudyptula-challenge-solutions/useful_scripts/sending_mutt.sh
similarity index 100%
rename from First_edition_2014/other_resources/eudyptula-challenge-solutions/useful_scripts/sending_mutt.sh
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/eudyptula-challenge-solutions/useful_scripts/sending_mutt.sh
diff --git a/First_edition_2014/other_resources/interview_cake/bitwise_stuff/clean_bit.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/bitwise_stuff/clean_bit.py
similarity index 100%
rename from First_edition_2014/other_resources/interview_cake/bitwise_stuff/clean_bit.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/bitwise_stuff/clean_bit.py
diff --git a/First_edition_2014/other_resources/interview_cake/bitwise_stuff/count_bits.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/bitwise_stuff/count_bits.py
similarity index 100%
rename from First_edition_2014/other_resources/interview_cake/bitwise_stuff/count_bits.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/bitwise_stuff/count_bits.py
diff --git a/First_edition_2014/other_resources/interview_cake/bitwise_stuff/get_bit.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/bitwise_stuff/get_bit.py
similarity index 100%
rename from First_edition_2014/other_resources/interview_cake/bitwise_stuff/get_bit.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/bitwise_stuff/get_bit.py
diff --git a/First_edition_2014/other_resources/interview_cake/bitwise_stuff/update_bit.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/bitwise_stuff/update_bit.py
similarity index 100%
rename from First_edition_2014/other_resources/interview_cake/bitwise_stuff/update_bit.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/bitwise_stuff/update_bit.py
diff --git a/First_edition_2014/other_resources/interview_cake/data_structures/angry_bird.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/data_structures/angry_bird.py
similarity index 100%
rename from First_edition_2014/other_resources/interview_cake/data_structures/angry_bird.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/data_structures/angry_bird.py
diff --git a/First_edition_2014/other_resources/interview_cake/data_structures/file_system_hashing.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/data_structures/file_system_hashing.py
similarity index 100%
rename from First_edition_2014/other_resources/interview_cake/data_structures/file_system_hashing.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/data_structures/file_system_hashing.py
diff --git a/First_edition_2014/other_resources/interview_cake/data_structures/inflight_entrain.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/data_structures/inflight_entrain.py
similarity index 100%
rename from First_edition_2014/other_resources/interview_cake/data_structures/inflight_entrain.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/data_structures/inflight_entrain.py
diff --git a/First_edition_2014/other_resources/interview_cake/math/apple_stocks.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/math/apple_stocks.py
similarity index 100%
rename from First_edition_2014/other_resources/interview_cake/math/apple_stocks.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/math/apple_stocks.py
diff --git a/First_edition_2014/other_resources/interview_cake/math/fib.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/math/fib.py
similarity index 100%
rename from First_edition_2014/other_resources/interview_cake/math/fib.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/math/fib.py
diff --git a/First_edition_2014/other_resources/interview_cake/math/find_dup.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/math/find_dup.py
similarity index 100%
rename from First_edition_2014/other_resources/interview_cake/math/find_dup.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/math/find_dup.py
diff --git a/First_edition_2014/other_resources/interview_cake/math/float_bin_num.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/math/float_bin_num.py
similarity index 100%
rename from First_edition_2014/other_resources/interview_cake/math/float_bin_num.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/math/float_bin_num.py
diff --git a/First_edition_2014/other_resources/interview_cake/math/highest_product_3_int.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/math/highest_product_3_int.py
similarity index 100%
rename from First_edition_2014/other_resources/interview_cake/math/highest_product_3_int.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/math/highest_product_3_int.py
diff --git a/First_edition_2014/other_resources/interview_cake/math/in_place_shuffle.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/math/in_place_shuffle.py
similarity index 100%
rename from First_edition_2014/other_resources/interview_cake/math/in_place_shuffle.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/math/in_place_shuffle.py
diff --git a/First_edition_2014/other_resources/interview_cake/math/product_every_int.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/math/product_every_int.py
similarity index 100%
rename from First_edition_2014/other_resources/interview_cake/math/product_every_int.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/math/product_every_int.py
diff --git a/First_edition_2014/other_resources/interview_cake/math/recursive_per.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/math/recursive_per.py
similarity index 100%
rename from First_edition_2014/other_resources/interview_cake/math/recursive_per.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/math/recursive_per.py
diff --git a/First_edition_2014/other_resources/interview_cake/sort_and_search/big_words.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/sort_and_search/big_words.py
similarity index 100%
rename from First_edition_2014/other_resources/interview_cake/sort_and_search/big_words.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/sort_and_search/big_words.py
diff --git a/First_edition_2014/other_resources/interview_cake/sort_and_search/binary_search.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/sort_and_search/binary_search.py
similarity index 100%
rename from First_edition_2014/other_resources/interview_cake/sort_and_search/binary_search.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/sort_and_search/binary_search.py
diff --git a/First_edition_2014/other_resources/interview_cake/sort_and_search/merge_sort.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/sort_and_search/merge_sort.py
similarity index 100%
rename from First_edition_2014/other_resources/interview_cake/sort_and_search/merge_sort.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/sort_and_search/merge_sort.py
diff --git a/First_edition_2014/other_resources/interview_cake/sort_and_search/merge_sorted_list.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/sort_and_search/merge_sorted_list.py
similarity index 100%
rename from First_edition_2014/other_resources/interview_cake/sort_and_search/merge_sorted_list.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/sort_and_search/merge_sorted_list.py
diff --git a/First_edition_2014/other_resources/interview_cake/strings/hical_str_manipulation.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/strings/hical_str_manipulation.py
similarity index 100%
rename from First_edition_2014/other_resources/interview_cake/strings/hical_str_manipulation.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/strings/hical_str_manipulation.py
diff --git a/First_edition_2014/other_resources/interview_cake/strings/online_poker.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/strings/online_poker.py
similarity index 100%
rename from First_edition_2014/other_resources/interview_cake/strings/online_poker.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/strings/online_poker.py
diff --git a/First_edition_2014/other_resources/interview_cake/strings/palindrome.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/strings/palindrome.py
similarity index 100%
rename from First_edition_2014/other_resources/interview_cake/strings/palindrome.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/strings/palindrome.py
diff --git a/First_edition_2014/other_resources/interview_cake/strings/reverse_in_place.py b/MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/strings/reverse_in_place.py
similarity index 100%
rename from First_edition_2014/other_resources/interview_cake/strings/reverse_in_place.py
rename to MY_BOOK/ebook_src/real_interview_problems/other_resources/interview_cake/strings/reverse_in_place.py
diff --git a/First_edition_2014/ebook_src/real_interview_problems/palindome.py b/MY_BOOK/ebook_src/real_interview_problems/palindome.py
similarity index 100%
rename from First_edition_2014/ebook_src/real_interview_problems/palindome.py
rename to MY_BOOK/ebook_src/real_interview_problems/palindome.py
diff --git a/First_edition_2014/ebook_src/real_interview_problems/permutation.py b/MY_BOOK/ebook_src/real_interview_problems/permutation.py
similarity index 100%
rename from First_edition_2014/ebook_src/real_interview_problems/permutation.py
rename to MY_BOOK/ebook_src/real_interview_problems/permutation.py
diff --git a/First_edition_2014/ebook_src/real_interview_problems/queue.py b/MY_BOOK/ebook_src/real_interview_problems/queue.py
similarity index 100%
rename from First_edition_2014/ebook_src/real_interview_problems/queue.py
rename to MY_BOOK/ebook_src/real_interview_problems/queue.py
diff --git a/First_edition_2014/ebook_src/real_interview_problems/quick_sort.py b/MY_BOOK/ebook_src/real_interview_problems/quick_sort.py
similarity index 100%
rename from First_edition_2014/ebook_src/real_interview_problems/quick_sort.py
rename to MY_BOOK/ebook_src/real_interview_problems/quick_sort.py
diff --git a/First_edition_2014/ebook_src/real_interview_problems/reverse_str.py b/MY_BOOK/ebook_src/real_interview_problems/reverse_str.py
similarity index 100%
rename from First_edition_2014/ebook_src/real_interview_problems/reverse_str.py
rename to MY_BOOK/ebook_src/real_interview_problems/reverse_str.py
diff --git a/First_edition_2014/ebook_src/real_interview_problems/stack.py b/MY_BOOK/ebook_src/real_interview_problems/stack.py
similarity index 100%
rename from First_edition_2014/ebook_src/real_interview_problems/stack.py
rename to MY_BOOK/ebook_src/real_interview_problems/stack.py
diff --git a/requirements.txt b/MY_BOOK/ebook_src/requirements.txt
similarity index 67%
rename from requirements.txt
rename to MY_BOOK/ebook_src/requirements.txt
index 33aaeda..e79bb92 100644
--- a/requirements.txt
+++ b/MY_BOOK/ebook_src/requirements.txt
@@ -1,12 +1,12 @@
-SQLAlchemy==0.9.7
+SQLAlchemy==1.3.0
bpython==0.13.1
coverage==3.7.1
curtsies==0.0.34
graphviz==0.4.2
-ipython==0.13.2
+ipython==8.10.0
matplotlib==1.3.1
nose==1.3.0
-numpy==1.8.2
+numpy==1.22.0
scapy==2.4.1
scikit-learn==0.14.1
-scipy==0.12.1
\ No newline at end of file
+scipy==1.10.0
\ No newline at end of file
diff --git a/First_edition_2014/ebook_src/builtin_structures/__init__.py b/MY_BOOK/ebook_src/searching_and_sorting/searching/__init__.py
old mode 100755
new mode 100644
similarity index 100%
rename from First_edition_2014/ebook_src/builtin_structures/__init__.py
rename to MY_BOOK/ebook_src/searching_and_sorting/searching/__init__.py
diff --git a/First_edition_2014/ebook_src/searching_and_sorting/searching/binary_search.py b/MY_BOOK/ebook_src/searching_and_sorting/searching/binary_search.py
similarity index 100%
rename from First_edition_2014/ebook_src/searching_and_sorting/searching/binary_search.py
rename to MY_BOOK/ebook_src/searching_and_sorting/searching/binary_search.py
diff --git a/First_edition_2014/ebook_src/searching_and_sorting/searching/binary_search_matrix.py b/MY_BOOK/ebook_src/searching_and_sorting/searching/binary_search_matrix.py
similarity index 100%
rename from First_edition_2014/ebook_src/searching_and_sorting/searching/binary_search_matrix.py
rename to MY_BOOK/ebook_src/searching_and_sorting/searching/binary_search_matrix.py
diff --git a/First_edition_2014/ebook_src/searching_and_sorting/searching/find_item_rotated_sorted_array.py b/MY_BOOK/ebook_src/searching_and_sorting/searching/find_item_rotated_sorted_array.py
similarity index 100%
rename from First_edition_2014/ebook_src/searching_and_sorting/searching/find_item_rotated_sorted_array.py
rename to MY_BOOK/ebook_src/searching_and_sorting/searching/find_item_rotated_sorted_array.py
diff --git a/First_edition_2014/ebook_src/searching_and_sorting/searching/find_max_unimodal_array.py b/MY_BOOK/ebook_src/searching_and_sorting/searching/find_max_unimodal_array.py
similarity index 100%
rename from First_edition_2014/ebook_src/searching_and_sorting/searching/find_max_unimodal_array.py
rename to MY_BOOK/ebook_src/searching_and_sorting/searching/find_max_unimodal_array.py
diff --git a/First_edition_2014/ebook_src/searching_and_sorting/searching/find_sqrt_bin_search.py b/MY_BOOK/ebook_src/searching_and_sorting/searching/find_sqrt_bin_search.py
similarity index 100%
rename from First_edition_2014/ebook_src/searching_and_sorting/searching/find_sqrt_bin_search.py
rename to MY_BOOK/ebook_src/searching_and_sorting/searching/find_sqrt_bin_search.py
diff --git a/First_edition_2014/ebook_src/searching_and_sorting/searching/find_str_array_with_empty_str.py b/MY_BOOK/ebook_src/searching_and_sorting/searching/find_str_array_with_empty_str.py
similarity index 100%
rename from First_edition_2014/ebook_src/searching_and_sorting/searching/find_str_array_with_empty_str.py
rename to MY_BOOK/ebook_src/searching_and_sorting/searching/find_str_array_with_empty_str.py
diff --git a/First_edition_2014/ebook_src/searching_and_sorting/searching/find_time_occurence_list.py b/MY_BOOK/ebook_src/searching_and_sorting/searching/find_time_occurence_list.py
similarity index 92%
rename from First_edition_2014/ebook_src/searching_and_sorting/searching/find_time_occurence_list.py
rename to MY_BOOK/ebook_src/searching_and_sorting/searching/find_time_occurence_list.py
index af26ded..c7fa6e0 100644
--- a/First_edition_2014/ebook_src/searching_and_sorting/searching/find_time_occurence_list.py
+++ b/MY_BOOK/ebook_src/searching_and_sorting/searching/find_time_occurence_list.py
@@ -2,7 +2,7 @@
__author__ = "bt3"
-def binary_serch_counting(lst1, k, lo=0, hi=None):
+def binary_search_counting(lst1, k, lo=0, hi=None):
if hi is None: hi = len(lst1)
while lo < hi:
mid = (lo+hi)//2
@@ -24,7 +24,7 @@ def find_time_occurrence_list(seq, k):
the dict is fixed. Another way, since the array is sorted, it to
use binary search, since this is only O(logn).
"""
- index_some_k = binary_serch_counting(seq, k)
+ index_some_k = binary_search_counting(seq, k)
count = 1
sizet = len(seq)
diff --git a/First_edition_2014/ebook_src/searching_and_sorting/searching/ordered_sequential_search.py b/MY_BOOK/ebook_src/searching_and_sorting/searching/ordered_sequential_search.py
similarity index 100%
rename from First_edition_2014/ebook_src/searching_and_sorting/searching/ordered_sequential_search.py
rename to MY_BOOK/ebook_src/searching_and_sorting/searching/ordered_sequential_search.py
diff --git a/First_edition_2014/ebook_src/searching_and_sorting/searching/quick_select.py b/MY_BOOK/ebook_src/searching_and_sorting/searching/quick_select.py
similarity index 100%
rename from First_edition_2014/ebook_src/searching_and_sorting/searching/quick_select.py
rename to MY_BOOK/ebook_src/searching_and_sorting/searching/quick_select.py
diff --git a/First_edition_2014/ebook_src/searching_and_sorting/searching/searching_in_a_matrix.py b/MY_BOOK/ebook_src/searching_and_sorting/searching/searching_in_a_matrix.py
similarity index 100%
rename from First_edition_2014/ebook_src/searching_and_sorting/searching/searching_in_a_matrix.py
rename to MY_BOOK/ebook_src/searching_and_sorting/searching/searching_in_a_matrix.py
diff --git a/First_edition_2014/ebook_src/searching_and_sorting/searching/sequential_search.py b/MY_BOOK/ebook_src/searching_and_sorting/searching/sequential_search.py
similarity index 100%
rename from First_edition_2014/ebook_src/searching_and_sorting/searching/sequential_search.py
rename to MY_BOOK/ebook_src/searching_and_sorting/searching/sequential_search.py
diff --git a/First_edition_2014/ebook_src/searching_and_sorting/sorting/1.dat b/MY_BOOK/ebook_src/searching_and_sorting/sorting/1.dat
similarity index 100%
rename from First_edition_2014/ebook_src/searching_and_sorting/sorting/1.dat
rename to MY_BOOK/ebook_src/searching_and_sorting/sorting/1.dat
diff --git a/First_edition_2014/ebook_src/searching_and_sorting/sorting/2.dat b/MY_BOOK/ebook_src/searching_and_sorting/sorting/2.dat
similarity index 100%
rename from First_edition_2014/ebook_src/searching_and_sorting/sorting/2.dat
rename to MY_BOOK/ebook_src/searching_and_sorting/sorting/2.dat
diff --git a/First_edition_2014/ebook_src/searching_and_sorting/sorting/3.dat b/MY_BOOK/ebook_src/searching_and_sorting/sorting/3.dat
similarity index 100%
rename from First_edition_2014/ebook_src/searching_and_sorting/sorting/3.dat
rename to MY_BOOK/ebook_src/searching_and_sorting/sorting/3.dat
diff --git a/First_edition_2014/ebook_src/searching_and_sorting/searching/__init__.py b/MY_BOOK/ebook_src/searching_and_sorting/sorting/__init__.py
similarity index 100%
rename from First_edition_2014/ebook_src/searching_and_sorting/searching/__init__.py
rename to MY_BOOK/ebook_src/searching_and_sorting/sorting/__init__.py
diff --git a/First_edition_2014/ebook_src/searching_and_sorting/sorting/bubble_sort.py b/MY_BOOK/ebook_src/searching_and_sorting/sorting/bubble_sort.py
similarity index 100%
rename from First_edition_2014/ebook_src/searching_and_sorting/sorting/bubble_sort.py
rename to MY_BOOK/ebook_src/searching_and_sorting/sorting/bubble_sort.py
diff --git a/First_edition_2014/ebook_src/searching_and_sorting/sorting/count_sort.py b/MY_BOOK/ebook_src/searching_and_sorting/sorting/count_sort.py
similarity index 100%
rename from First_edition_2014/ebook_src/searching_and_sorting/sorting/count_sort.py
rename to MY_BOOK/ebook_src/searching_and_sorting/sorting/count_sort.py
diff --git a/First_edition_2014/ebook_src/searching_and_sorting/sorting/gnome_sort.py b/MY_BOOK/ebook_src/searching_and_sorting/sorting/gnome_sort.py
similarity index 100%
rename from First_edition_2014/ebook_src/searching_and_sorting/sorting/gnome_sort.py
rename to MY_BOOK/ebook_src/searching_and_sorting/sorting/gnome_sort.py
diff --git a/First_edition_2014/ebook_src/searching_and_sorting/sorting/heap.py b/MY_BOOK/ebook_src/searching_and_sorting/sorting/heap.py
similarity index 100%
rename from First_edition_2014/ebook_src/searching_and_sorting/sorting/heap.py
rename to MY_BOOK/ebook_src/searching_and_sorting/sorting/heap.py
diff --git a/First_edition_2014/ebook_src/searching_and_sorting/sorting/heap_sort.py b/MY_BOOK/ebook_src/searching_and_sorting/sorting/heap_sort.py
similarity index 100%
rename from First_edition_2014/ebook_src/searching_and_sorting/sorting/heap_sort.py
rename to MY_BOOK/ebook_src/searching_and_sorting/sorting/heap_sort.py
diff --git a/First_edition_2014/ebook_src/searching_and_sorting/sorting/insertion_sort.py b/MY_BOOK/ebook_src/searching_and_sorting/sorting/insertion_sort.py
similarity index 100%
rename from First_edition_2014/ebook_src/searching_and_sorting/sorting/insertion_sort.py
rename to MY_BOOK/ebook_src/searching_and_sorting/sorting/insertion_sort.py
diff --git a/First_edition_2014/ebook_src/searching_and_sorting/sorting/merge_and_sort_two_arrays.py b/MY_BOOK/ebook_src/searching_and_sorting/sorting/merge_and_sort_two_arrays.py
similarity index 100%
rename from First_edition_2014/ebook_src/searching_and_sorting/sorting/merge_and_sort_two_arrays.py
rename to MY_BOOK/ebook_src/searching_and_sorting/sorting/merge_and_sort_two_arrays.py
diff --git a/First_edition_2014/ebook_src/searching_and_sorting/sorting/merge_sort.py b/MY_BOOK/ebook_src/searching_and_sorting/sorting/merge_sort.py
similarity index 100%
rename from First_edition_2014/ebook_src/searching_and_sorting/sorting/merge_sort.py
rename to MY_BOOK/ebook_src/searching_and_sorting/sorting/merge_sort.py
diff --git a/First_edition_2014/ebook_src/searching_and_sorting/sorting/quick_sort.py b/MY_BOOK/ebook_src/searching_and_sorting/sorting/quick_sort.py
similarity index 100%
rename from First_edition_2014/ebook_src/searching_and_sorting/sorting/quick_sort.py
rename to MY_BOOK/ebook_src/searching_and_sorting/sorting/quick_sort.py
diff --git a/First_edition_2014/ebook_src/searching_and_sorting/sorting/selection_sort.py b/MY_BOOK/ebook_src/searching_and_sorting/sorting/selection_sort.py
similarity index 100%
rename from First_edition_2014/ebook_src/searching_and_sorting/sorting/selection_sort.py
rename to MY_BOOK/ebook_src/searching_and_sorting/sorting/selection_sort.py
diff --git a/First_edition_2014/ebook_src/searching_and_sorting/sorting/sort_anagrams_together.py b/MY_BOOK/ebook_src/searching_and_sorting/sorting/sort_anagrams_together.py
similarity index 100%
rename from First_edition_2014/ebook_src/searching_and_sorting/sorting/sort_anagrams_together.py
rename to MY_BOOK/ebook_src/searching_and_sorting/sorting/sort_anagrams_together.py
diff --git a/First_edition_2014/ebook_src/searching_and_sorting/sorting/__init__.py b/MY_BOOK/ebook_src/trees/__init__.py
old mode 100644
new mode 100755
similarity index 100%
rename from First_edition_2014/ebook_src/searching_and_sorting/sorting/__init__.py
rename to MY_BOOK/ebook_src/trees/__init__.py
diff --git a/First_edition_2014/ebook_src/trees/binary_search_tree.py b/MY_BOOK/ebook_src/trees/binary_search_tree.py
similarity index 98%
rename from First_edition_2014/ebook_src/trees/binary_search_tree.py
rename to MY_BOOK/ebook_src/trees/binary_search_tree.py
index 9f82203..d0802d4 100755
--- a/First_edition_2014/ebook_src/trees/binary_search_tree.py
+++ b/MY_BOOK/ebook_src/trees/binary_search_tree.py
@@ -19,7 +19,7 @@ class Node(object):
new_node = Node(value)
if not self.item:
- self.item = new_node
+ self.item = new_node.value
else:
if value > self.item:
diff --git a/First_edition_2014/ebook_src/trees/binary_tree.py b/MY_BOOK/ebook_src/trees/binary_tree.py
similarity index 100%
rename from First_edition_2014/ebook_src/trees/binary_tree.py
rename to MY_BOOK/ebook_src/trees/binary_tree.py
diff --git a/First_edition_2014/ebook_src/trees/binary_tree_generators.py b/MY_BOOK/ebook_src/trees/binary_tree_generators.py
similarity index 100%
rename from First_edition_2014/ebook_src/trees/binary_tree_generators.py
rename to MY_BOOK/ebook_src/trees/binary_tree_generators.py
diff --git a/First_edition_2014/ebook_src/trees/bunchclass.py b/MY_BOOK/ebook_src/trees/bunchclass.py
similarity index 100%
rename from First_edition_2014/ebook_src/trees/bunchclass.py
rename to MY_BOOK/ebook_src/trees/bunchclass.py
diff --git a/First_edition_2014/ebook_src/trees/check_ancestor.py b/MY_BOOK/ebook_src/trees/check_ancestor.py
similarity index 100%
rename from First_edition_2014/ebook_src/trees/check_ancestor.py
rename to MY_BOOK/ebook_src/trees/check_ancestor.py
diff --git a/First_edition_2014/ebook_src/trees/check_if_balanced.py b/MY_BOOK/ebook_src/trees/check_if_balanced.py
similarity index 100%
rename from First_edition_2014/ebook_src/trees/check_if_balanced.py
rename to MY_BOOK/ebook_src/trees/check_if_balanced.py
diff --git a/First_edition_2014/ebook_src/trees/check_if_bst.py b/MY_BOOK/ebook_src/trees/check_if_bst.py
similarity index 97%
rename from First_edition_2014/ebook_src/trees/check_if_bst.py
rename to MY_BOOK/ebook_src/trees/check_if_bst.py
index 792013f..eb8e8da 100755
--- a/First_edition_2014/ebook_src/trees/check_if_bst.py
+++ b/MY_BOOK/ebook_src/trees/check_if_bst.py
@@ -37,7 +37,7 @@ def isBST_other_method(node, max_node=None, min_node=None):
if node.right:
if node.right.item < node.item or node.right.item < min_node:
- rihjt = False
+ right = False
else:
min_node = node.item
right = isBST(node.right, max_node, min_node)
diff --git a/First_edition_2014/ebook_src/trees/check_largest_item.py b/MY_BOOK/ebook_src/trees/check_largest_item.py
similarity index 100%
rename from First_edition_2014/ebook_src/trees/check_largest_item.py
rename to MY_BOOK/ebook_src/trees/check_largest_item.py
diff --git a/First_edition_2014/ebook_src/trees/simple_tree.py b/MY_BOOK/ebook_src/trees/simple_tree.py
similarity index 100%
rename from First_edition_2014/ebook_src/trees/simple_tree.py
rename to MY_BOOK/ebook_src/trees/simple_tree.py
diff --git a/First_edition_2014/ebook_src/trees/transversal.py b/MY_BOOK/ebook_src/trees/transversal.py
similarity index 100%
rename from First_edition_2014/ebook_src/trees/transversal.py
rename to MY_BOOK/ebook_src/trees/transversal.py
diff --git a/First_edition_2014/ebook_src/trees/trie.py b/MY_BOOK/ebook_src/trees/trie.py
similarity index 100%
rename from First_edition_2014/ebook_src/trees/trie.py
rename to MY_BOOK/ebook_src/trees/trie.py
diff --git a/README.md b/README.md
index 211e6c7..f9f15db 100644
--- a/README.md
+++ b/README.md
@@ -1,13 +1,67 @@
-## Book on Python, Algorithms, and Data Structures
+## š¾š master algorithms with python (and my book š¤)
+
+
-- [PDF and source code for 1st edition (2014, published by Hanbit Media)](https://github.com/bt3gl/Python-and-Algorithms-and-Data-Structures/blob/master/First_edition_2014/ebook_pdf/book_second_edition.pdf).
+
+
+
+
-This work is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](http://creativecommons.org/licenses/by-sa/4.0/).
+
+
+
+
+
+
+---
+
+### external resources
+
+
+
+* **[big-o complexities chart and explanation](https://www.bigocheatsheet.com/)**
diff --git a/Second_edition_2019/README.md b/Second_edition_2019/README.md
deleted file mode 100644
index 8de71bf..0000000
--- a/Second_edition_2019/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-## Python, Algorithms, and Data Structures (2nd Edition, 2019)
-
-
-
diff --git a/arrays_and_strings/3rd_distinct_n.py b/arrays_and_strings/3rd_distinct_n.py
new file mode 100644
index 0000000..dbaa778
--- /dev/null
+++ b/arrays_and_strings/3rd_distinct_n.py
@@ -0,0 +1,45 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# author: bt3gl
+
+'''
+Given an integer array nums, return the third distinct maximum
+number in this array. If the third maximum does not exist,
+return the maximum number.
+
+Do it O(n).
+'''
+
+import math
+
+
+def third_max(nums: list[int]) -> int:
+
+ first_max = -math.inf
+ second_max = -math.inf
+ third_max = -math.inf
+
+ for n in nums:
+
+ if n == first_max or n == second_max or n == third_max:
+ continue
+ elif n > first_max:
+ third_max = second_max
+ second_max = first_max
+ first_max = n
+ elif n > second_max:
+ third_max = second_max
+ second_max = n
+ elif n > third_max:
+ third_max = n
+
+ if third_max == -math.inf:
+ third_max = max(second_max, first_max)
+
+ return third_max
+
+
+if __name__ == "__main__":
+
+ nums = [3,2,1]
+ assert(third_max(nums) == 1)
diff --git a/arrays_and_strings/README.md b/arrays_and_strings/README.md
new file mode 100644
index 0000000..7ea7cdc
--- /dev/null
+++ b/arrays_and_strings/README.md
@@ -0,0 +1,406 @@
+## arrays and strings
+
+
+
+* arrays and strings hold values of the same type at contiguous memory locations with the advantage of storing multiple elements of the same type with one single variable name.
+
+* we are usually concerned with two things: the index of an element, and the element itself.
+
+* accessing elements is fast as long as you have the index (as opposed to linked lists that need to be traversed from the head).
+
+* addition or removal of elements into/from the middle of an array is slow because the remaining elements need to be shifted to accommodate the new/missing element (unless they are inserted/removed at the end of the list).
+
+* **subarray**: a range of contiguous values within an array (for example, in `[2, 3, 6, 1, 5, 4]`, `[3, 6, 1]` is a subarray while `[3, 1, 5]` is not).
+
+* **subsequence**: a sequence derived from the given sequence without changing the order (for example, in `[2, 3, 6, 1, 5, 4]`, `[3, 1, 5]` is a subsequence but `[3, 5, 1]` is not).
+
+
+
+----
+
+### two-pointer technique
+
+
+
+* a typical scenario is when you want to iterate the array from two ends to the middle or when pointers can cross each others (or even be in different arrays).
+
+* another scenario is when you need one slow-runner and one fast-runner at the same time (so that you can determine the movement strategy for both pointers).
+
+* in any case, this technique is usually used when the array is sorted.
+
+* in the **sliding window** technique, the two pointers usually move in the same direction and never overtake each other. examples are: longest substring without repeating characters, minimum size subarray sum, and minimum window substring.
+
+
+
+----
+
+### intervals
+
+
+
+* checking if two intervals overlap:
+
+```python
+def is_overlap(a, b):
+ return a[0] < b[1] and b[0] < a[1]
+```
+
+
+
+* merging two intervals:
+
+```python
+def merge_overlapping_intervals(a, b):
+ return [min(a[0], b[0]), max(a[1], b[1])]
+```
+
+
+
+
+---
+
+### two-dimensional arrays
+
+
+
+* a matrix is a 2d array. they can be used to represent graphs where each node is a cell on the matrix which has 4 neighbors (except those cells on the edge and corners).
+
+* in some languages (like C++), 2d arrays are represented as 1d, so an array of `m * n` elements represents `array[i][j]` as `array[i * n + j]`.
+
+* creating an empty matrix:
+
+
+
+```python
+zero_matrix = [ [0 for _ in range(len(matrix[0]))] for _ in range(len(matrix)) ]
+```
+
+
+
+* copying a matrix:
+
+
+
+```python
+copied_matrix = [ row[:] for row in mattrix ]
+```
+
+
+
+* the transpose of a matrix can be found by interchanging its rows into columns or columns into rows:
+
+
+
+```python
+transposed = zip(*matrix)
+```
+
+
+
+---
+
+### check if mountain
+
+
+
+```python
+def valid_mountain_array(arr: list[int]) -> bool:
+
+ last_number, mountain_up = arr[0], True
+
+ for i, n in enumerate(arr[1:]):
+
+ if n > last_number:
+ if mountain_up == False:
+ return False
+
+ elif n < last_number:
+ if i == 0:
+ return False
+ mountain_up = False
+
+ else:
+ return False
+
+ last_number = n
+
+ return not mountain_up
+```
+
+
+
+---
+
+### duplicate zeros in place
+
+
+
+```python
+def duplicate_zeros(arr: list[int]) -> list[int]:
+
+ i = 0
+ while i < len(arr):
+
+ if arr[i] == 0 and i != len(arr) - 1:
+
+ range_here = len(arr) - (i + 2)
+ while range_here > 0:
+ arr[i + range_here + 1] = arr[i + range_here]
+ range_here -= 1
+
+ arr[i+1] = 0
+ i += 2
+
+ else:
+ i += 1
+
+ return arr
+```
+
+
+
+----
+
+### remove duplicates in place
+
+
+
+```python
+def remove_duplicates(nums: list[int]) -> int:
+
+ arr_i, dup_i = 0, 1
+
+ while arr_i < len(nums) and dup_i < len(nums):
+
+ if nums[arr_i] == nums[dup_i]:
+ dup_i += 1
+
+ else:
+ arr_i += 1
+ nums[arr_i] = nums[dup_i]
+
+ for i in range(arr_i + 1, dup_i):
+ nums[i] = '_'
+
+ return dup_i - arr_i - 1, nums
+```
+
+
+
+---
+
+### anagrams
+
+
+
+* to determine if two strings are anagrams, there are a few approaches:
+ - sorting both strings should produce the same string (`O(N log(N))` time and `O(log(N))` space.
+ - if we map each character to a prime number and we multiply each mapped number together, anagrams should have the same multiple (prime factor decomposition, `O(N)`).
+ - frequency counting of characters can determine whether they are anagram (`O(N)`).
+
+
+
+```python
+def is_anagram(string1, string2) -> bool:
+
+ string1 = string1.lower()
+ string2 = string2.lower()
+
+ if len(string1) != len(string2):
+ return False
+
+ for c in string1:
+ if c not in string2:
+ return False
+
+ return True
+```
+
+
+
+
+
+----
+
+### palindromes
+
+
+
+* ways to determine if a string is a palindrome:
+ * reverse the string and they should be equal.
+ * have two pointers at the start and end of the string, moving the pointers until they meet.
+
+
+
+```python
+def is_palindrome(sentence):
+
+ sentence = sentence.strip(' ')
+ if len(sentence) < 2:
+ return True
+
+ if sentence[0] == sentence[-1]:
+ return is_palindrome(sentence[1:-1])
+
+ return False
+```
+
+
+
+
+```python
+def is_permutation_of_palindromes(some_string):
+
+ aux_dict = {}
+
+ for c in some_string.strip():
+
+ if c in aux_dict.keys():
+ aux_dict[c] -= 1
+ else:
+ aux_dict[c] = 1
+
+ for v in aux_dict.values():
+ if v != 0:
+ return False
+
+ return True
+```
+
+
+
+
+
+
+---
+
+### intersection of two arrays
+
+
+
+```python
+def intersect(nums1: list[int], nums2: list[int]) -> list[int]:
+
+ result = []
+ set_nums = set(nums1) & set(nums2)
+ counter = Counter(nums1) & Counter(nums2)
+
+ for n in set_nums:
+ result.extend([n] * counter[n])
+
+ return result
+```
+
+
+
+---
+
+
+### check if isomorphic
+
+
+
+```python
+def is_isomorphic(s: str, t: str) -> bool:
+
+ map_s_to_t = {}
+ map_t_to_s = {}
+
+ for ss, tt in zip(s, t):
+
+ if (ss not in map_s_to_t) and (tt not in map_t_to_s):
+ map_s_to_t[ss] = tt
+ map_t_to_s[tt] = ss
+
+ elif (map_s_to_t.get(ss) != tt) or (map_t_to_s.get(tt) != ss):
+ return False
+
+ return True
+```
+
+
+
+---
+
+### absolute difference between the sums of a matrix's diagonals
+
+
+
+```python
+
+def diagonal_difference(arr):
+
+ diag_1 = 0
+ diag_2 = 0
+
+ i, j = 0, len(arr) - 1
+
+ while i < len(arr) and j >= 0:
+
+ diag_1 += arr[i][i]
+ diag_2 += arr[i][j]
+ i += 1
+ j -= 1
+
+ return diag_1, diag_2, abs(diag_1 - diag_2)
+```
+
+
+
+
+
+---
+
+### find permutations
+
+
+
+```python
+
+
+def permutations(string) -> list:
+
+ if len(string) == 1:
+ return [string]
+
+ result = []
+ for i, char in enumerate(string):
+ for perm in permutation(string[:i] + string[i+1:]):
+ result += [char + perm]
+
+ return result
+```
+
+
+
+---
+
+### length of the longest substring
+
+
+
+```python
+def length_longest_substring(s) -> int:
+
+ result = ""
+ this_longest_string = ""
+ i = 0
+
+ for c in s:
+ j = 0
+
+ while j < len(this_longest_string):
+
+ if c == this_longest_string[j]:
+ if len(this_longest_string) > len(result):
+ result = this_longest_string
+ this_longest_string = this_longest_string[j+1:]
+
+ j += 1
+
+ this_longest_string += c
+
+ return result, this_longest_string
+```
+
+
diff --git a/arrays_and_strings/check_if_exist.py b/arrays_and_strings/check_if_exist.py
new file mode 100644
index 0000000..15ec58b
--- /dev/null
+++ b/arrays_and_strings/check_if_exist.py
@@ -0,0 +1,31 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# author: bt3gl
+
+"""
+Given an array arr of integers, check if there exist two indices i and j such that :
+
+i != j
+0 <= i, j < arr.length
+arr[i] == 2 * arr[j]
+"""
+
+
+def check_if_exist(arr: list[int]) -> bool:
+
+ aux_dict = {}
+
+ for i, num in enumerate(arr):
+ aux_dict[2 * num] = i
+
+ for j, num in enumerate(arr):
+ if num in aux_dict.keys() and j != aux_dict[num]:
+ return (j, aux_dict[num])
+
+
+ return False
+
+if __name__ == "__main__":
+
+ arr = [-2, 0, 10, -19, 4, 6, -8]
+ print(check_if_exist(arr))
diff --git a/arrays_and_strings/check_mountain.py b/arrays_and_strings/check_mountain.py
new file mode 100644
index 0000000..c29cd00
--- /dev/null
+++ b/arrays_and_strings/check_mountain.py
@@ -0,0 +1,36 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# author: bt3gl
+
+'''
+Given an array of integers arr, return true if and only if it is a valid mountain array.
+An array is a moutain array if and only if:
+
+arr.length >= 3
+There exists some i with 0 < i < arr.length - 1 such that:
+arr[0] < arr[1] < ... < arr[i - 1] < arr[i]
+arr[i] > arr[i + 1] > ... > arr[arr.length - 1]
+'''
+
+def valid_mountain_array(arr: list[int]) -> bool:
+
+ last_number, mountain_up = arr[0], True
+
+ for i, n in enumerate(arr[1:]):
+
+ if n > last_number:
+ if mountain_up == False:
+ return False
+
+ elif n < last_number:
+ if i == 0:
+ return False
+ mountain_up = False
+
+ else:
+ return False
+
+ last_number = n
+
+ return not mountain_up
+
diff --git a/arrays_and_strings/check_permutation_strings_is_palindrome.py b/arrays_and_strings/check_permutation_strings_is_palindrome.py
new file mode 100644
index 0000000..44efd9f
--- /dev/null
+++ b/arrays_and_strings/check_permutation_strings_is_palindrome.py
@@ -0,0 +1,21 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# author: bt3gl
+
+
+def is_permutation_of_palindromes(some_string):
+
+ aux_dict = {}
+
+ for c in some_string.strip():
+
+ if c in aux_dict.keys():
+ aux_dict[c] -= 1
+ else:
+ aux_dict[c] = 1
+
+ for v in aux_dict.values():
+ if v != 0:
+ return False
+
+ return True
diff --git a/arrays_and_strings/duplicate_zeros_inplace.py b/arrays_and_strings/duplicate_zeros_inplace.py
new file mode 100644
index 0000000..055d41a
--- /dev/null
+++ b/arrays_and_strings/duplicate_zeros_inplace.py
@@ -0,0 +1,27 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# author: bt3gl
+
+# Given a fixed-length integer array arr, duplicate each occurrence of zero,
+# shifting the remaining elements to the right.
+
+
+def duplicate_zeros(arr: list[int]) -> list[int]:
+
+ i = 0
+ while i < len(arr):
+
+ if arr[i] == 0 and i != len(arr) - 1:
+
+ range_here = len(arr) - (i + 2)
+ while range_here > 0:
+ arr[i + range_here + 1] = arr[i + range_here]
+ range_here -= 1
+
+ arr[i+1] = 0
+ i += 2
+
+ else:
+ i += 1
+
+ return arr
diff --git a/arrays_and_strings/intersection_two_arrays.py b/arrays_and_strings/intersection_two_arrays.py
new file mode 100644
index 0000000..cc91c7e
--- /dev/null
+++ b/arrays_and_strings/intersection_two_arrays.py
@@ -0,0 +1,16 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# author: bt3gl
+
+
+def intersect(nums1: list[int], nums2: list[int]) -> list[int]:
+
+ result = []
+ set_nums = set(nums1) & set(nums2)
+ counter = Counter(nums1) & Counter(nums2)
+
+ for n in set_nums:
+ result.extend([n] * counter[n])
+
+ return result
+
diff --git a/arrays_and_strings/is_anagram.py b/arrays_and_strings/is_anagram.py
new file mode 100644
index 0000000..989409b
--- /dev/null
+++ b/arrays_and_strings/is_anagram.py
@@ -0,0 +1,18 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# author: bt3gl
+
+
+def is_anagram(string1, string2) -> bool:
+
+ string1 = string1.lower()
+ string2 = string2.lower()
+
+ if len(string1) != len(string2):
+ return False
+
+ for c in string1:
+ if c not in string2:
+ return False
+
+ return True
diff --git a/arrays_and_strings/is_isomorphic.py b/arrays_and_strings/is_isomorphic.py
new file mode 100644
index 0000000..c5fd564
--- /dev/null
+++ b/arrays_and_strings/is_isomorphic.py
@@ -0,0 +1,20 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# author: bt3gl
+
+
+def is_isomorphic(s: str, t: str) -> bool:
+
+ map_s_to_t = {}
+ map_t_to_s = {}
+
+ for ss, tt in zip(s, t):
+
+ if (ss not in map_s_to_t) and (tt not in map_t_to_s):
+ map_s_to_t[ss] = tt
+ map_t_to_s[tt] = ss
+
+ elif (map_s_to_t.get(ss) != tt) or (map_t_to_s.get(tt) != ss):
+ return False
+
+ return True
diff --git a/arrays_and_strings/longest_non_repeating.py b/arrays_and_strings/longest_non_repeating.py
new file mode 100644
index 0000000..cd9d0d4
--- /dev/null
+++ b/arrays_and_strings/longest_non_repeating.py
@@ -0,0 +1,27 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# author: bt3gl
+
+
+def length_longest_substring(s) -> int:
+
+ result = ""
+ this_longest_string = ""
+ i = 0
+
+ for c in s:
+ j = 0
+
+ while j < len(this_longest_string):
+
+ if c == this_longest_string[j]:
+ if len(this_longest_string) > len(result):
+ result = this_longest_string
+ this_longest_string = this_longest_string[j+1:]
+
+ j += 1
+
+ this_longest_string += c
+
+ return result, this_longest_string
+
diff --git a/arrays_and_strings/matrix_sum_diagonals.py b/arrays_and_strings/matrix_sum_diagonals.py
new file mode 100644
index 0000000..ae00c52
--- /dev/null
+++ b/arrays_and_strings/matrix_sum_diagonals.py
@@ -0,0 +1,20 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# author: bt3gl
+
+def diagonal_difference(arr):
+
+ diag_1 = 0
+ diag_2 = 0
+
+ i, j = 0, len(arr) - 1
+
+ while i < len(arr) and j >= 0:
+
+ diag_1 += arr[i][i]
+ diag_2 += arr[i][j]
+ i += 1
+ j -= 1
+
+ return diag_1, diag_2, abs(diag_1 - diag_2)
+
diff --git a/arrays_and_strings/merge_inplace.py b/arrays_and_strings/merge_inplace.py
new file mode 100644
index 0000000..d6703e9
--- /dev/null
+++ b/arrays_and_strings/merge_inplace.py
@@ -0,0 +1,40 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# author: bt3gl
+
+"""
+You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two
+integers m and n, representing the number of elements in nums1 and nums2 respectively.
+
+Merge nums1 and nums2 into a single array sorted in non-decreasing order.
+
+The final sorted array should not be returned by the function,
+but instead be stored inside the array nums1.
+To accommodate this, nums1 has a length of m + n, where the first m elements denote the elements
+that should be merged, and the last n elements are set to 0 and should be ignored. nums2 has a length of n.
+"""
+
+def merge(big_list: list[int], m: int, small_list: list[int], n: int) -> None:
+
+ index_big, index_small, index_backward = m - 1, n - 1, m + n - 1
+
+ while index_big >= 0 and index_small >= 0:
+
+ if small_list[index_small] > big_list[index_big]:
+ big_list[index_backward] = small_list[index_small]
+ index_small -= 1
+ else:
+ big_list[index_backward] = big_list[index_big]
+ index_big -= 1
+
+ index_backward -= 1
+
+ while index_backward >= 0 and index_big >= 0:
+ big_list[index_backward] = big_list[index_big]
+ index_backward -= 1
+ index_big -= 1
+
+ while index_backward >= 0 and index_small >= 0:
+ big_list[index_backward] = small_list[index_small]
+ index_backward -= 1
+ index_small -= 1
diff --git a/arrays_and_strings/move_zeros_inplace.py b/arrays_and_strings/move_zeros_inplace.py
new file mode 100644
index 0000000..ae8cf7d
--- /dev/null
+++ b/arrays_and_strings/move_zeros_inplace.py
@@ -0,0 +1,38 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# author: bt3gl
+
+
+'''
+Given an integer array nums, move all 0's to the end of it while
+maintaining the relative order of the non-zero elements.
+
+Note that you must do this in-place without making a copy of the array.
+Example 1:
+
+Input: nums = [0,1,0,3,12]
+Output: [1,3,12,0,0]
+Example 2:
+
+Input: nums = [0]
+Output: [0]
+'''
+
+
+def move_zeroes(nums: list[int]) -> list[int]:
+
+ i = 0
+
+ while i < len(nums) - 1:
+
+ if nums[i] == 0:
+ j = i + 1
+ while nums[j] == 0 and j < len(nums) - 1:
+ j += 1
+
+ nums[i], nums[j] = nums[j], nums[i]
+
+ i += 1
+
+
+ return nums
diff --git a/arrays_and_strings/palindrome.py b/arrays_and_strings/palindrome.py
new file mode 100644
index 0000000..ad39b0c
--- /dev/null
+++ b/arrays_and_strings/palindrome.py
@@ -0,0 +1,14 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# author: bt3gl
+
+def is_palindrome(sentence):
+
+ sentence = sentence.strip(' ')
+ if len(sentence) < 2:
+ return True
+
+ if sentence[0] == sentence[-1]:
+ return is_palindrome(sentence[1:-1])
+
+ return False
diff --git a/arrays_and_strings/permutations.py b/arrays_and_strings/permutations.py
new file mode 100644
index 0000000..f778c12
--- /dev/null
+++ b/arrays_and_strings/permutations.py
@@ -0,0 +1,16 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# author: bt3gl
+
+
+def permutations(string) -> list:
+
+ if len(string) == 1:
+ return [string]
+
+ result = []
+ for i, char in enumerate(string):
+ for perm in permutation(string[:i] + string[i+1:]):
+ result += [char + perm]
+
+ return result
diff --git a/arrays_and_strings/pivot_index_array.py b/arrays_and_strings/pivot_index_array.py
new file mode 100644
index 0000000..cb1336b
--- /dev/null
+++ b/arrays_and_strings/pivot_index_array.py
@@ -0,0 +1,17 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# author: bt3gl
+
+
+def pivot_index(nums):
+
+ s, left_sum = sum(nums), 0
+
+ for i, x in enumerate(nums):
+
+ if left_sum == (s - left_sum - x):
+ return i
+
+ left_sum += x
+
+ return -1
diff --git a/arrays_and_strings/playing_with_strings.py b/arrays_and_strings/playing_with_strings.py
new file mode 100644
index 0000000..1d1bb67
--- /dev/null
+++ b/arrays_and_strings/playing_with_strings.py
@@ -0,0 +1,6 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# author: bt3gl
+
+def reverse_array_in_place(array):
+ return array[::-1]
diff --git a/arrays_and_strings/remove_dups_inplace.py b/arrays_and_strings/remove_dups_inplace.py
new file mode 100644
index 0000000..a63a715
--- /dev/null
+++ b/arrays_and_strings/remove_dups_inplace.py
@@ -0,0 +1,24 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# author: bt3gl
+
+
+
+def remove_duplicates(nums: list[int]) -> int:
+
+ arr_i, dup_i = 0, 1
+
+ while arr_i < len(nums) and dup_i < len(nums):
+
+ if nums[arr_i] == nums[dup_i]:
+ dup_i += 1
+
+ else:
+ arr_i += 1
+ nums[arr_i] = nums[dup_i]
+
+ for i in range(arr_i + 1, dup_i):
+ nums[i] = '_'
+
+ return dup_i - arr_i - 1, nums
+
diff --git a/arrays_and_strings/return_matrix_in_spiral.py b/arrays_and_strings/return_matrix_in_spiral.py
new file mode 100644
index 0000000..ba13ae3
--- /dev/null
+++ b/arrays_and_strings/return_matrix_in_spiral.py
@@ -0,0 +1,34 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# author: bt3gl
+
+
+def spiral_order(matrix):
+
+ result = []
+ rows, cols = len(matrix), len(matrix[0])
+ up = left = 0
+ right = cols - 1
+ down = rows - 1
+
+ while len(result) < rows * cols:
+ for col in range(left, right + 1):
+ result.append(matrix[up][col])
+
+ for row in range(up + 1, down + 1):
+ result.append(matrix[row][right])
+
+ if up != down:
+ for col in range(right - 1, left - 1, -1):
+ result.append(matrix[down][col])
+
+ if left != right:
+ for row in range(down - 1, up, -1):
+ result.append(matrix[row][left])
+
+ left += 1
+ right -= 1
+ up += 1
+ down -= 1
+
+ return result
diff --git a/arrays_and_strings/two_sums.py b/arrays_and_strings/two_sums.py
new file mode 100644
index 0000000..ac133e5
--- /dev/null
+++ b/arrays_and_strings/two_sums.py
@@ -0,0 +1,16 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# author: bt3gl
+
+
+def two_sum(nums: list[int], target: int) -> list[int]:
+
+ aux_dict = {}
+ for i, n in enumerate(nums):
+ complement = target - n
+
+ if complement in aux_dict:
+ return [aux_dict[complement][0], i]
+
+ aux_dict[n] = (i, n)
+
diff --git a/arrays_and_strings/unique_word_abbreviation.py b/arrays_and_strings/unique_word_abbreviation.py
new file mode 100644
index 0000000..6394018
--- /dev/null
+++ b/arrays_and_strings/unique_word_abbreviation.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# author: bt3gl
+
+'''
+The abbreviation of a word is a concatenation of its first letter,
+the number of characters between the first and last letter, and its
+last letter. If a word has only two characters, then it is an abbreviation of itself.
+Returns true if either of the following conditions are met (otherwise returns false):
+- There is no word in dictionary whose abbreviation is equal to word's abbreviation.
+- For any word in dictionary whose abbreviation is equal to word's abbreviation,
+that word and word are the same.
+'''
+
+class ValidWordAbbr:
+
+ def __init__(self, dictionary):
+
+ self.dict = collections.defaultdict(set)
+ for w in dictionary:
+ aux_dict[self.get_abr(w)].add(w)
+
+ return aux_dict
+
+ def get_abr(self, word):
+
+ return word[0] + str(len(word[1:-1])) + word[-1] if len(word) != 2 else word
+
+ def is_unique(self, word: str) -> bool:
+
+ abr = self.get_abr(word)
+ words = self.dict[abr]
+
+ return len(words) == 0 or (len(words) == 1 and word in words)
+
diff --git a/bit_operations/README.md b/bit_operations/README.md
new file mode 100644
index 0000000..d41b63c
--- /dev/null
+++ b/bit_operations/README.md
@@ -0,0 +1,299 @@
+## bit manipulation
+
+
+
+
+### techniques
+
+
+
+* test if kth bit is set: `num & (1 << k) != 0`
+
+* set kth bit: `num |= (1 << k)`
+
+* turn off kth bit: `num &= ~(1 << k)`
+
+* toggle the kth bit: `num ^= (1 << k)`
+
+* multiply by `2^k`: `num << k`
+
+* divide by `2^k`: `num >> k`
+
+* check if a number is a power of 2: `(num & num - 1) == 0` or `(num & (-num)) == num`
+
+* swapping two variables: `num1 ^= num2; num2 ^= num`; `num1 ^= num2`
+
+
+
+
+
+---
+
+### converting a decimal to another base (`X`)
+
+
+
+* the **base** is a carry counting system with fixed digital symbols and rules.
+
+* you need to convert the integer part and the fractional part separately.
+
+* to convert the integer part, integer divide it by `X` until it reaches `0`, and record the remainder each time.
+
+* traversing the remainder in reverse order will give the representation in the base-X system.
+
+```
+50/2 = 25, 25/2 = 12, 12/2 = 6, 6/2 = 3, 3/2 = 1, 1/2 = 0
+50%2 = 0, 25%2 = 1, 12%2 = 0, 6%2 = 0, 3%2 = 1, 1%2 = 1
+--> 110010
+```
+
+* to convert a fractional part, multiply the fractional part of the decimal number by `X `until it becomes `0`, and record the integer part each time.
+
+```
+0.6875x2 = 1.375 with integer 1,
+0.375x2 = 0.75 with integer 0,
+0.75x2 = 1.5 with integer 1,
+0.5x2 = 1, with integer 1
+--> 0.1011
+```
+
+
+
+```python
+def convert_to_any_base(base: int, num: int) -> str:
+
+ if num == 0:
+ return "0"
+
+ n = abs(num)
+ result = ""
+
+ while n:
+ result += str(n % base)
+ n //= base
+
+ if num < 0:
+ result += '-'
+
+ return result[::-1]
+```
+
+
+
+
+
+----
+
+### hexadecimal
+
+
+
+* an integer of type int can be represented as a `32-bit` binary number.
+
+* since a one-digit hexadecimal number corresponds to a four-digit binary number, an integer of type int can also be represented as an `8-bit` hexadecimal number.
+
+
+
+```python
+def convert_to_hex(num: int) -> str:
+
+ hex_chars = "0123456789abcdef"
+ size = 32
+ base = 16
+
+ if num == 0:
+ return "0"
+
+ if num < 1:
+ num += 2**size
+
+ result = ""
+ while num:
+ result += hex_chars[num % base]
+ num //= base
+
+ return result[::-1]
+```
+
+
+
+----
+
+### binary in computers
+
+
+
+* a single binary digit has two possible values, and a `k`-digit binary number can take `2^k` possible values.
+
+* `1-byte` number (`8` digits binary number) has `2^8` possible values.
+
+* in a `1-byte` signed integer, when the highest bit is `0`, the `1-byte` number ranges from `0` to `127` (`2^7 - 1`), when the highest bit is `1`, it ranges from `-128` to `-1` (*i.e.,* `-128` to `127`, which is `-2^7` to `2^7 -1`).
+
+* the binary representation of a number in a computer is called its **machine number**. it's a signed number, and the highest bit of the machine number is the sign bit `0`.
+
+* inverse code: for non-negative numbers, it's the same, for negative numbers, you flip every bit of the original code, except the sign bit.
+ * introducing the inverse code solves the problem of subtraction errors, but the issue of dual representation of `0` remains.
+* complement code: is obtained from the inverse code, for non-negative numbers it's the same, for negative numbers it's obtained by adding `1` to the inverse code. for example, for `-10`, the original code is `10001010`, the inverse code is `11110101`, and the complement code is `11110110`.
+ * the complement code solves both the subtraction error and dual representation of the `0` problem (in complement code, there is no `-0`).,
+
+
+
+----
+
+### bit operations
+
+
+
+- there are 6 types of bit operations: `AND`, `OR`, `XOR`, `negation`, `left shift`, and `right shift` (shift operations are further divided into the arithmetic shift and logical shift):
+ - `OR` and `AND`: symmetrical operations.
+ - `XOR`: when the corresponding bits of the two numbers are the same, the result is `1`.
+ - negation is unary: just flips the bit.
+ - left shift operation, `<<`, all binary bits are shifted to the left (the high bits are discarded, and the low bits are filled with 0). for left shift operations, arithmetic shift and logical shift are the same.
+ - right shift operation, `>>`, all binary bits are shift to the right (low bits are discarded). how the high bits get filled differs between arithmetic shift and logical shift:
+ - when shifting right arithmetically, the high bits are filled with the highest bit.
+ - when shifting right logically, the high bits are filled with `0`.
+ - for non-negative numbers, the arithmetic right shift and logical right shift are identical.
+ - for signed types, the right shift operation is an arithmetic right shift; for unsigned types, the right shift operation is a logical right shift.
+ - for languages without unsigned data type, the arithmetic right shift is `>>` and the logical shift is `>>>`.
+
+
+
+----
+
+### relationship with multiplication/division
+
+
+
+* left shift corresponds to multiplication: shifting a number to the left by `k` bits is equivalent to multiplying the number by `2^k`.
+ * when the multiplier is not an integer power of `2`, the multiplier can be split into the sum of the integer power of two.
+ * for example, `a x 6` is equivalent to `(a << 2) + (a << 1)`.
+ * be careful against overflow.
+
+* arithmetic right-shift corresponds to the division: shifting a number to the right by k bits is equivalent to dividing the number by `2^k` for non-negative numbers.
+ * integer division is rounded to `0`, and the right shift operation is rounded down, which is also rounded to `0`.
+ * for negative numbers, integer division is rounded to `0`, while the right shift is rounded down -> so it's not equivalent to dividing a number by `2^k`.
+
+
+
+-----
+
+### properties of bitwise operations
+
+
+
+* idempotent: `a & a = a`
+
+* commutativity: `a & b = b &a`
+
+* associativity: `(a & b) & c = a * (b & c)`
+
+* distributive: `(a & b} | c = (a | c) & (b | c)`
+
+* de morgan's law: `~(a & b) = (~a) | (~b); ~ (a | b) = (~a) & (~b)`
+
+* 0 XOR: `a XOR 0 = a`; `a XOR a = 0`
+
+* `a & (a - 1)` changes the last 1 in the binary representation of a to 0.
+
+* ` a & (-a)` (equivalent to `a & (~(a - 1)`) keeps only the last 1 of the binary representation of a and sets the remaining 1s to 0.
+
+
+
+
+----
+
+### two's complement method
+
+
+
+* the complement is the number with respect to `2**n`:
+
+1. start with the equivalent positive number
+2. invert (or flip) all bits, changing every `0` to `1`, and every `1` to `0`
+3. add `1` to the entire inverted number, ignoring overflow
+
+
+
+---
+
+### playing with bits
+
+
+
+```python
+def count_ones(n: int) -> int:
+
+ counter = 0
+
+ while n:
+
+ if n & 1:
+ counter += 1
+
+ n >>= 1
+
+ return counter
+
+def set_bit(num, i):
+ mask = 1 << i
+ return bin( num | mask )
+
+def update_bit(num, i, v):
+ mask = ~ (1 << i)
+ return bin( (num & mask) | (v << i) )
+
+def count_bits_swapped(a, b):
+ count = 0
+ m = a^b
+ while m:
+ count +=1
+ m = m & (m-1)
+ return count
+
+def clear_bit(num, i):
+ mask = ~ (1 << i) # -0b10001
+ return bin(num & mask)
+
+def swap_bit_in_place(a, b):
+ a = a^b
+ b = a^b
+ a = a^b
+ return a, b
+
+def find_how_many_1_in_a_binary(num):
+
+ counter = 0
+ while num:
+ if num & 1:
+ counter += 1
+ num >>= 1
+ return counter
+
+def reverse_bits(n: int) -> int:
+
+ result, base = 0, 31
+ while n:
+ result += (n & 1) << base
+ n >>= 1
+ base -= 1
+
+ return result
+
+def get_sum(self, a: int, b: int) -> int:
+
+ if a == -b:
+ return 0
+
+ if abs(a) > abs(b):
+ a, b = b, a
+
+ if a < 0:
+ return - get_sum(-a, -b)
+
+ while b:
+
+ c = a & b
+ a, b = a ^ b, c << 1
+
+ return a
+```
diff --git a/bit_operations/convert_any_base.py b/bit_operations/convert_any_base.py
new file mode 100644
index 0000000..e24830d
--- /dev/null
+++ b/bit_operations/convert_any_base.py
@@ -0,0 +1,21 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# author: bt3gl
+
+
+def convert_to_any_base(base: int, num: int) -> str:
+
+ if num == 0:
+ return "0"
+
+ n = abs(num)
+ result = ""
+
+ while n:
+ result += str(n % base)
+ n //= base
+
+ if num < 0:
+ result += '-'
+
+ return result[::-1]
diff --git a/bit_operations/convert_to_hex.py b/bit_operations/convert_to_hex.py
new file mode 100644
index 0000000..0b25aec
--- /dev/null
+++ b/bit_operations/convert_to_hex.py
@@ -0,0 +1,23 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# author: bt3gl
+
+
+def convert_to_hex(num: int) -> str:
+
+ hex_chars = "0123456789abcdef"
+ size = 32
+ base = 16
+
+ if num == 0:
+ return "0"
+
+ if num < 1:
+ num += 2**size
+
+ result = ""
+ while num:
+ result += hex_chars[num % base]
+ num //= base
+
+ return result[::-1]
diff --git a/bit_operations/count_1s.py b/bit_operations/count_1s.py
new file mode 100644
index 0000000..b841a8e
--- /dev/null
+++ b/bit_operations/count_1s.py
@@ -0,0 +1,17 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# author: bt3gl
+
+
+def count_ones(n: int) -> int:
+
+ counter = 0
+
+ while n:
+
+ if n & 1:
+ counter += 1
+
+ n >>= 1
+
+ return counter
diff --git a/bit_operations/playing_with_bits.py b/bit_operations/playing_with_bits.py
new file mode 100644
index 0000000..b03fa18
--- /dev/null
+++ b/bit_operations/playing_with_bits.py
@@ -0,0 +1,59 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# author: bt3gl
+
+
+def set_bit(num, i):
+ mask = 1 << i
+ return bin( num | mask )
+
+def update_bit(num, i, v):
+ mask = ~ (1 << i)
+ return bin( (num & mask) | (v << i) )
+
+def count_bits_swapped(a, b):
+ count = 0
+ m = a^b
+ while m:
+ count +=1
+ m = m & (m-1)
+ return count
+
+def clear_bit(num, i):
+ mask = ~ (1 << i) # -0b10001
+ return bin(num & mask)
+
+def swap_bit_in_place(a, b):
+ a = a^b
+ b = a^b
+ a = a^b
+ return a, b
+
+def find_how_many_1_in_a_binary(num):
+
+ counter = 0
+ while num:
+ if num & 1:
+ counter += 1
+ num >>= 1
+ return counter
+
+
+if __name__ == '__main__':
+
+ binary_number = '10010000'
+ binary_number2 = '01011010'
+ integer_number = int(binary_number, 2)
+ integer_number2 = int(binary_number2, 2)
+
+ print(f'Integer number: {integer_number}')
+ print(f'Binary number: {binary_number}')
+ print(f'\nUpdate bit: {update_bit(integer_number, 2, 1)}')
+ print(f'Set bit: {set_bit(integer_number, 2)}')
+ print(f'Clear bit: {clear_bit(integer_number, 4)}')
+ print(f'\nI: {integer_number}, I2: {integer_number2}')
+ print(f'B: {binary_number}, B2: {binary_number2}')
+ print(f'Count bits swapped: {count_bits_swapped(integer_number, integer_number2)}')
+ print(f'\nSwap bit in place: {swap_bit_in_place(integer_number, integer_number2)}')
+ print(f'Find how many 1 in a binary: {find_how_many_1_in_a_binary(integer_number)}')
+
\ No newline at end of file
diff --git a/bit_operations/reverse_bits.py b/bit_operations/reverse_bits.py
new file mode 100644
index 0000000..cf2984f
--- /dev/null
+++ b/bit_operations/reverse_bits.py
@@ -0,0 +1,14 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# author: bt3gl
+
+def reverse_bits(n: int) -> int:
+
+ result, base = 0, 31
+
+ while n:
+ result += (n & 1) << base
+ n >>= 1
+ base -= 1
+
+ return result
diff --git a/bit_operations/sum_with_bitwise.py b/bit_operations/sum_with_bitwise.py
new file mode 100644
index 0000000..cb0b004
--- /dev/null
+++ b/bit_operations/sum_with_bitwise.py
@@ -0,0 +1,22 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# author: bt3gl
+
+
+def get_sum(self, a: int, b: int) -> int:
+
+ if a == -b:
+ return 0
+
+ if abs(a) > abs(b):
+ a, b = b, a
+
+ if a < 0:
+ return - get_sum(-a, -b)
+
+ while b:
+
+ c = a & b
+ a, b = a ^ b, c << 1
+
+ return a
diff --git a/dynamic_programming/README.md b/dynamic_programming/README.md
new file mode 100644
index 0000000..0398542
--- /dev/null
+++ b/dynamic_programming/README.md
@@ -0,0 +1,253 @@
+## dynamic programming
+
+
+
+* dynamic programming is the process of taking a recursive algorithm and cache overlapping problems (repeated calls). the runtime is given by the number of calls.
+
+* **top-down** (**memoization**): how can we divide the problem into sub-problems?
+
+* **bottom-up** (**tabulation**): solve for a simple case, then figure out for more elements.
+
+
+
+
+---
+
+### recursion
+
+
+
+* recursion is an approach to solving problems using a function that calls itself as a subroutine. every time the function calls itself, it reduces the problem into subproblems. the recursion calls continue until it reaches a point where the subproblem can be solved without further recursion.
+
+* a recursive function should have the following properties so it does not result in an infinite loop:
+ * one or more base cases (a terminating scenario that does not use recursion to produce an answer)
+ * a set of rules, also known as a recurrence relation, that reduces all other cases towards the base case.
+
+
+
+```python
+def fib(n):
+ if n <= 1:
+ return n
+ return fib(n - 1) + fib(n - 2)
+```
+
+
+
+* there can be multiple places where the function may call itself.
+
+* any recursion problem can be solved iteratively and vice-versa.
+
+* the **master theorem** is an advanced technique of asymptotic analysis (time complexity) for many of the recursion algorithms that follow the pattern of divide-and-conquer.
+
+
+
+
+#### vizualing the stack
+
+
+
+* to visualize how the stack operates during recursion calls, check the example below where we reverse a string:
+
+
+
+```python
+def reverse(s):
+ if len(s) == 0:
+ return s
+ else:
+ return reverse(s[1:]) + s[0]
+```
+
+
+
+
+#### tail recursion
+
+
+
+* tail recursion is a recursion where the recursive call is the final instruction in the recursion function. and there should be only one recursive call in the function.
+
+* tail recursion is exempted from the space overhead discussed above, ad it skips an entire chain of recursive calls returning and returns straight to the original caller (it does not need a call stack for all the recursive calls - instead of allocating new space on the stack, the system could simply reuse the space allocated earlier for this second recursion call).
+
+* when stack overflows, tail recursion might help.
+
+* some languages' compiler recognizes tail recursion pattern and optimizes their execution (e.g., C and C++, but not Java, Rust, or Python - although it's possible to implement ad-hoc).
+
+
+
+```python
+def sum_non_tail_recursion(ls):
+ if len(ls) == 0:
+ return 0
+
+ # not a tail recursion because it does some computation after the recursive call returned
+ return ls[0] + sum_non_tail_recursion(ls[1:])
+
+
+def sum_tail_recursion(ls):
+
+ def helper(ls, acc):
+ if len(ls) == 0:
+ return acc
+
+ # this is a tail recursion because the final instruction is a recursive call
+ return helper(ls[1:], ls[0] + acc)
+
+ return helper(ls, 0)
+```
+
+
+
+
+
+---
+
+### memoization
+
+
+
+* memoization is an optimization technique that avoids recursion's duplicate calculations.
+
+* it's primarily used to speed up code by storing the intermediate results in a cache so that it can be reused later.
+
+* for example, a hash table can be used as a cache and should be passed along each subroutine call.
+
+
+
+```python
+function dp(dp_state, memo_dict):
+
+ if dp_state is the base cases
+ return things like 0 or null
+
+ if dp_state in memo_dict
+ return memo_dict[dp_state]
+
+ calculate dp(dp_state) from dp(other_state)
+ save dp_state and the result into memo_dict
+
+function answerToProblem(input)
+ return dp(start_state, empty_memo_dict)
+```
+
+
+
+* classic examples where memoization can be used are fibonacci and the "climbing stairs" problem:
+
+
+
+```python
+def climb_stairs_memoization(n: int) -> int:
+
+ memo = {}
+
+ def helper(n: int, memo: dict[int, int]) -> int:
+ if n == 0 or n == 1:
+ return 1
+ if n not in memo:
+ memo[n] = helper(n-1, memo) + helper(n-2, memo)
+ return memo[n]
+
+ return helper(n, memo)
+```
+
+
+
+* another good example is calculating all possible subnodes in a tree:
+
+
+
+```python
+class Node:
+ def __init__(self, val=0, left=None, right=None):
+ self.val = val
+ self.left = left
+ self.right = right
+
+
+def all_possible_bst(start, end, memo):
+
+ result = []
+ if start > end:
+ return result
+
+ if (start, end) in memo:
+ return memo[(start, end)]
+
+ for i in range(start, end + 1):
+ left = all_possible_bst(start, i - 1, memo)
+ right = all_possible_bst(i + 1, end, memo)
+
+ for l in left:
+ for r in right:
+ result.append(Node(i, l, r))
+
+ memo[(start, end)] = result
+ return result
+
+
+def generate_trees(n):
+
+ memo = {}
+ return all_possible_bst(1, n, memo)
+```
+
+
+
+----
+
+### time complexity
+
+
+
+* the time complexity of a recursion algorithm is the product of the number of recursion invocations and the time complexity of the calculation, `R*O(s)`.
+
+* you can also look at the "execution tree", which is a tree that is used to denote the execution flow of a recursive function in particular. each node represents an invocation of the recursive function. therefore, the total number of nodes in the tree corresponds to the number of recursion calls during the execution.
+ * the execution tree of a recursive function would form a n-ary tree, with as the number of times recursion appears in the recurrence relation (for example, fibonacci would be a binary tree).
+ * in a full binary tree with n levels, the total number of nodes is `2**N - 1`, so `O(2**N)` would be the time complexity of the function.
+ * with memoization, fibonacci becomes `O(1)*N = O(N)`.
+
+
+
+----
+
+### space complexity
+
+
+
+* there are mainly two parts of the space consumption that one should see in a recursive algorithm:
+ * **recursion related space**: refers to the memory cost that is incurred directly by the recursion, i.e. the stack to keep track of recursive function calls. in order to complete a recursive call, the system allocates some space in the stack to hold: the returning address of the function call, the parameters that are passed to the function call, the local variables within the function call. once the function call is done, the space is freed. for recursive algorithms, the function calls chain up successively until it reaches a base case, so the space used for each call is accumulated. overconsumption can cause stack overflow.
+ * **non-recursive related space**: refers to the memory that is not directly related to recursion, which includes the space (normally in heap) that is allocated for global variables.
+
+
+
+
+---
+
+### backtracking
+
+
+
+* backtracking is a general algorithm for finding solutions to some computation problems, which incrementally builds candidates to the solution and abandons a candidate ("backtracks") as soon as it determines that the candidate cannot lead to a valid solution.
+
+* you can imagine the procedure as the tree traversal.
+
+
+
+```python
+def backtrack(candidate):
+ if find_solution(candidate):
+ output(candidate)
+ return
+
+ for next in list_of_candidates:
+
+ if is_valid(next_candidate):
+ place(next_candidate)
+ backtrack(next_candidate)
+ remove(next_candidate)
+````
+
+
+
diff --git a/dynamic_programming/bst_all_subnodes.py b/dynamic_programming/bst_all_subnodes.py
new file mode 100644
index 0000000..4ac8255
--- /dev/null
+++ b/dynamic_programming/bst_all_subnodes.py
@@ -0,0 +1,37 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# author: bt3gl
+
+
+class Node:
+ def __init__(self, val=0, left=None, right=None):
+ self.val = val
+ self.left = left
+ self.right = right
+
+
+def all_possible_bst(start, end, memo):
+
+ result = []
+ if start > end:
+ return result
+
+ if (start, end) in memo:
+ return memo[(start, end)]
+
+ for i in range(start, end + 1):
+ left = all_possible_bst(start, i - 1, memo)
+ right = all_possible_bst(i + 1, end, memo)
+
+ for l in left:
+ for r in right:
+ result.append(Node(i, l, r))
+
+ memo[(start, end)] = result
+ return result
+
+
+def generate_trees(n):
+
+ memo = {}
+ return all_possible_bst(1, n, memo)
diff --git a/dynamic_programming/climbing_stairs.py b/dynamic_programming/climbing_stairs.py
new file mode 100644
index 0000000..c699acd
--- /dev/null
+++ b/dynamic_programming/climbing_stairs.py
@@ -0,0 +1,58 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# author: bt3gl
+
+'''
+You are climbing a staircase. It takes n steps to reach the top.
+Each time you can either climb 1 or 2 steps.
+In how many distinct ways can you climb to the top?
+'''
+
+
+def climb_stairs_o2n(n: int) -> int:
+
+ if n == 0 or n == 1:
+ return 1
+ return climb_stairs_o2n(n - 1) + climb_stairs_o2n(n - 2)
+
+
+def climb_stairs_memoization(n: int) -> int:
+
+ memo = {}
+
+ def helper(n: int, memo: dict[int, int]) -> int:
+ if n == 0 or n == 1:
+ return 1
+ if n not in memo:
+ memo[n] = helper(n - 1, memo) + helper(n - 2, memo)
+ return memo[n]
+
+ return helper(n, memo)
+
+
+def climb_stairs_optimized(n: int) -> int:
+
+ if n == 0 or n == 1:
+ return 1
+ prev, curr = 1, 1
+
+ for i in range(2, n + 1):
+ temp = curr
+ curr = prev + curr
+ prev = temp
+
+ return curr
+
+
+def climb_stairs_tabulation(n: int) -> int:
+
+ if n == 0 or n == 1:
+ return 1
+
+ dp = [0] * (n + 1)
+ dp[0] = dp[1] = 1
+
+ for i in range(2, n + 1):
+ dp[i] = dp[i - 1] + dp[i - 2]
+
+ return dp[n]
diff --git a/graphs/README.md b/graphs/README.md
new file mode 100644
index 0000000..e12cea3
--- /dev/null
+++ b/graphs/README.md
@@ -0,0 +1,339 @@
+## graphs
+
+
+
+* graph is a non-linear data structure consisting of vertices and edges.
+
+
+* graphs can be represented by adjacent matrices, adjacent lists, and hash table of hash tables.
+
+
+* in **undirected graphs**, the edges between any two vertices do not have a direction, indicating a two-way relationship.
+
+
+* in **directed graphs**, the edges between any two vertices are directional.
+
+
+* in **weighted graphs**, each edge has an associated weight. if the sum of the weights of all edges of a cycle is a negative values, it's a negative weight cycle.
+
+
+* the **degree of a vertex** is the number of edges connecting the vertex. in directed, graphs, if the **in-degree** of a vertex is `d`, there are **d** directional edges incident to the vertex (and similarly, **out-degree** from the vertex).
+
+
+* with `|V|` the number of vertices and `|E|` is the number of edges, search in a graph (either bfs of dfs) is `O(|V| + |E|)`.
+
+
+
+---
+
+### traversals
+
+
+
+#### breath first search
+
+
+
+* check **[../trees/#breath-first-search](https://github.com/go-outside-labs/master-algorithms-py/blob/master/trees/README.md#tree-traversal-depth-first-search)**
+
+
+
+```python
+def bfs(matrix):
+
+ if not matrix:
+ return []
+
+ rows, cols = len(matrix), len(matrix[0])
+ visited = set()
+ directions = ((0, 1), (0, -1), (1, 0), (-1, 0))
+
+ def traverse(i, j):
+ queue = deque([(i, j)])
+ while queue:
+ curr_i, curr_j = queue.popleft()
+ if (curr_i, curr_j) not in visited:
+ visited.add((curr_i, curr_j))
+
+ for direction in directions:
+ next_i, next_j = curr_i + direction[0], curr_j + direction[1]
+ if 0 <= next_i < rows and 0 <= next_j < cols:
+
+ queue.append((next_i, next_j))
+
+ for i in range(rows):
+ for j in range(cols):
+ traverse(i, j)
+```
+
+
+
+* or as a class:
+
+
+
+```python
+
+from collections import deque
+
+
+class Graph:
+
+ def __init__(self, edges, n):
+
+ self.adj_list = [[] for _ in range(n)]
+
+ for (src, dest) in edges:
+ self.adj_list[src].append(dest)
+ self.adj_list[dest].append(src)
+
+
+def bfs(graph, v, discovered):
+
+ queue = deque(v)
+ discovered[v] = True
+
+ while queue:
+
+ v = queue.popleft()
+ print(v, end=' ')
+
+ for u in graph.adj_list[v]:
+ if not discovered[u]:
+ discovered[u] = True
+ queue.append(u)
+
+
+def recursive_bfs(graph, queue, discovered):
+
+ if not queue:
+ return
+
+ v = queue.popleft()
+ print(v, end=' ')
+
+ for u in graph.adj_list[v]:
+ if not discovered[u]:
+ discovered[u] = True
+ queue.append(u)
+
+ recursive_bfs(graph, queue, discovered)
+```
+
+
+
+----
+
+#### depth first search
+
+
+
+* and **[../trees/#depth-first-search](https://github.com/go-outside-labs/master-algorithms-py/blob/master/trees/README.md#tree-traversal-breath-first-search-level-order)**
+
+
+
+```python
+def dfs(matrix):
+ if not matrix:
+ return []
+
+ rows, cols = len(matrix), len(matrix[0])
+ visited = set()
+ directions = ((0, 1), (0, -1), (1, 0), (-1, 0))
+
+ def traverse(i, j):
+ if (i, j) in visited:
+ return
+
+ visited.add((i, j))
+ for direction in directions:
+ next_i, next_j = i + direction[0], j + direction[1]
+ if 0 <= next_i < rows and 0 <= next_j < cols:
+ traverse(next_i, next_j)
+
+ for i in range(rows):
+ for j in range(cols):
+ traverse(i, j)
+```
+
+
+
+* or as a class:
+
+
+
+```python
+from collections import deque
+
+class Graph:
+
+ def __init__(self, edges, n):
+
+ self.adj_list = [[] for _ in range(n)]
+
+ for (src, dest) in edges:
+ self.adj_list[src].append(dest)
+ self.adj_list[dest].append(src)
+
+
+def dfs(graph, v, discovered):
+
+ discovered[v] = True
+ print(v, end=' ')
+
+ for u in graph.adj_list[v]:
+ if not discovered[u]:
+ dfs(graph, u, discovered)
+
+
+
+def iterative_dfs(graph, v, discovered):
+
+ stack = [v]
+
+ while stack:
+
+ v = stack.pop()
+
+ if discovered[v]:
+ continue
+
+ discovered[v] = True
+ print(v, end=' ')
+
+ adj_list = graph.adjList[v]
+ for i in reversed(range(len(adj_list))):
+ u = adj_list[i]
+ if not discovered[u]:
+ stack.append(u)
+```
+
+
+
+---
+
+### matrix bfs and dfs
+
+
+
+* given an `m x n` grid rooms initialized with these three possible values:
+ * -1 A wall or an obstacle.
+ * 0 A gate.
+ * `INF` Infinity means an empty room (`2^31 - 1 = 2147483647` to represent `INF`)
+
+* fill the empty room with the distance to its nearest gate. if it is impossible to reach a gate, it should be filled with `INF`.
+
+
+
+```python
+
+
+def matrix_bfs(rooms) -> None:
+
+ m = len(rooms)
+ if m == 0:
+ return rooms
+ n = len(rooms[0])
+
+ GATE = 0
+ EMPTY = 2147483647
+ DIRECTIONS = ((1, 0), (-1, 0), (0, 1), (0, -1))
+
+ queue = collections.deque()
+
+ for i in range(m):
+ for j in range(n):
+
+ if rooms[i][j] == GATE:
+ q.append((i, j))
+
+ while queue:
+
+ row, col = queue.popleft()
+
+ for (x, y) in DIRECTIONS:
+
+ r = row + x
+ c = col + y
+
+ if (r < 0) or (c < 0) or (r >= m) or (c >= n) or rooms[r][c] != EMPTY:
+ continue
+
+ rooms[r][c] = rooms[row][col] + 1
+ queue.append((r, c))
+```
+
+
+
+
+* given an `m x n` 2D binary grid grid which represents a map of '1's (land) and '0's (water), return the number of islands.
+
+
+
+```python
+def num_island_dfs(grid) -> int:
+
+ LAND = '1'
+ answer = 0
+
+ def dfs(row, col):
+
+ if row < 0 or row >= len(grid) or col < 0 or col >= len(grid[0]) or grid[row][col] != LAND:
+ return
+
+ grid[row][col] = 'x'
+ dfs(row + 1, col)
+ dfs(row - 1, col)
+ dfs(row, col - 1)
+ dfs(row, col + 1)
+
+ for i in range(len(grid)):
+ for j in range(len(grid[0])):
+ if grid[i][j] == LAND:
+ answer += 1
+ dfs(i, j)
+
+ return answer
+```
+
+
+
+* and a solution for the problem above, using bfs:
+
+
+
+```python
+def num_island_bfs(grid) -> int:
+
+ LAND = '1'
+ answer = 0
+ queue = collections.deque()
+
+ def bfs(row, col, queue):
+
+ delta = [(1, 0), (0, 1), (-1, 0), (0, -1)]
+
+ while queue:
+ x, y = queue.popleft()
+
+ for dx, dy in delta:
+
+ px, py = x + dx, y + dy
+ if px < 0 or px >= len(grid) or py < 0 or py >= len(grid[0]) or grid[px][py] != LAND:
+ continue
+
+ grid[px][py] = 'x'
+ queue.append((px, py))
+
+
+ for i in range(len(grid)):
+ for j in range(len(grid[0])):
+
+ if grid[i][j] == LAND:
+ answer += 1
+ queue.append((i, j))
+ bfs(i, j, queue)
+
+
+ return answer
+```
diff --git a/graphs/bfs.py b/graphs/bfs.py
new file mode 100644
index 0000000..edafb4c
--- /dev/null
+++ b/graphs/bfs.py
@@ -0,0 +1,49 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# author: bt3gl
+
+from collections import deque
+
+
+class Graph:
+
+ def __init__(self, edges, n):
+
+ self.adj_list = [[] for _ in range(n)]
+
+ for (src, dest) in edges:
+ self.adj_list[src].append(dest)
+ self.adj_list[dest].append(src)
+
+
+def bfs(graph, v, discovered):
+
+ queue = deque(v)
+ discovered[v] = True
+
+ while queue:
+
+ v = queue.popleft()
+ print(v, end=' ')
+
+ for u in graph.adj_list[v]:
+ if not discovered[u]:
+ discovered[u] = True
+ queue.append(u)
+
+
+def recursive_bfs(graph, queue, discovered):
+
+ if not queue:
+ return
+
+ v = queue.popleft()
+ print(v, end=' ')
+
+ for u in graph.adj_list[v]:
+ if not discovered[u]:
+ discovered[u] = True
+ queue.append(u)
+
+ recursive_bfs(graph, queue, discovered)
+
diff --git a/graphs/dfs.py b/graphs/dfs.py
new file mode 100644
index 0000000..a65a85b
--- /dev/null
+++ b/graphs/dfs.py
@@ -0,0 +1,49 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# author: bt3gl
+
+
+from collections import deque
+
+class Graph:
+
+ def __init__(self, edges, n):
+
+ self.adj_list = [[] for _ in range(n)]
+
+ for (src, dest) in edges:
+ self.adj_list[src].append(dest)
+ self.adj_list[dest].append(src)
+
+
+def dfs(graph, v, discovered):
+
+ discovered[v] = True
+ print(v, end=' ')
+
+ for u in graph.adj_list[v]:
+ if not discovered[u]: #
+ dfs(graph, u, discovered)
+
+
+
+def iterative_dfs(graph, v, discovered):
+
+ stack = [v]
+
+ while stack:
+
+ v = stack.pop()
+
+ if discovered[v]:
+ continue
+
+ discovered[v] = True
+ print(v, end=' ')
+
+ adj_list = graph.adjList[v]
+ for i in reversed(range(len(adj_list))):
+ u = adj_list[i]
+ if not discovered[u]:
+ stack.append(u)
+
diff --git a/graphs/dijkstra_adj_matrix.py b/graphs/dijkstra_adj_matrix.py
new file mode 100644
index 0000000..732e9c9
--- /dev/null
+++ b/graphs/dijkstra_adj_matrix.py
@@ -0,0 +1,70 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# author: bt3gl
+
+# dijkstra's single source shortest path algorithm
+# with adjacency matrix representation
+
+import sys
+
+
+class Graph():
+
+ def __init__(self, vertices):
+
+ self.V = vertices
+ self.graph = [[0 for col in range(vertices)] for row in range(vertices)]
+
+ def print_solution(self, dist):
+
+ print("Vertex \tDistance from Source")
+ for node in range(self.V):
+ print(node, "\t", dist[node])
+
+ def min_distance(self, dist, sset):
+
+ # minimum distance for next node
+ min_ = sys.maxsize
+
+ # search not nearest vertex not in the shortest path tree
+ for u in range(self.V):
+ if dist[u] < min_ and sset[u] == False:
+ min_ = dist[u]
+ min_index = u
+
+ return min_index
+
+
+ def dijkstra(self, src):
+
+ dist = [sys.maxsize] * self.V
+ dist[src] = 0
+ sset = [False] * self.V
+
+ for c in range(self.V):
+ x = self.min_distance(dist, sset)
+ sset[x] = True
+
+ for y in range(self.V):
+ if self.graph[x][y] > 0 and \
+ sset[y] == False and \
+ dist[y] > dist[x] + self.graph[x][y]:
+ dist[y] = dist[x] + self.graph[x][y]
+
+ self.print_solution(dist)
+
+
+if __name__ == "__main__":
+ g = Graph(9)
+ g.graph = [ [0, 4, 0, 0, 0, 0, 0, 8, 0],
+ [4, 0, 8, 0, 0, 0, 0, 11, 0],
+ [0, 8, 0, 7, 0, 4, 0, 0, 2],
+ [0, 0, 7, 0, 9, 14, 0, 0, 0],
+ [0, 0, 0, 9, 0, 10, 0, 0, 0],
+ [0, 0, 4, 14, 10, 0, 2, 0, 0],
+ [0, 0, 0, 0, 0, 2, 0, 1, 6],
+ [8, 11, 0, 0, 0, 0, 1, 0, 7],
+ [0, 0, 2, 0, 0, 0, 6, 7, 0]
+ ]
+
+ g.dijkstra(0)
diff --git a/graphs/matrix_bfs.py b/graphs/matrix_bfs.py
new file mode 100644
index 0000000..edf4737
--- /dev/null
+++ b/graphs/matrix_bfs.py
@@ -0,0 +1,38 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# author: bt3gl
+
+
+def matrix_bfs(rooms) -> None:
+
+ m = len(rooms)
+ if m == 0:
+ return rooms
+ n = len(rooms[0])
+
+ GATE = 0
+ EMPTY = 2147483647
+ DIRECTIONS = ((1, 0), (-1, 0), (0, 1), (0, -1))
+
+ queue = collections.deque()
+
+ for i in range(m):
+ for j in range(n):
+
+ if rooms[i][j] == GATE:
+ q.append((i, j))
+
+ while queue:
+
+ row, col = queue.popleft()
+
+ for (x, y) in DIRECTIONS:
+
+ r = row + x
+ c = col + y
+
+ if (r < 0) or (c < 0) or (r >= m) or (c >= n) or rooms[r][c] != EMPTY:
+ continue
+
+ rooms[r][c] = rooms[row][col] + 1
+ queue.append((r, c))
diff --git a/graphs/matrix_dfs_and_bfs.py b/graphs/matrix_dfs_and_bfs.py
new file mode 100644
index 0000000..f85a251
--- /dev/null
+++ b/graphs/matrix_dfs_and_bfs.py
@@ -0,0 +1,63 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# author: bt3gl
+
+
+def num_island_dfs(grid) -> int:
+
+ LAND = '1'
+ answer = 0
+
+ def dfs(row, col):
+
+ if row < 0 or row >= len(grid) or col < 0 or col >= len(grid[0]) or grid[row][col] != LAND:
+ return
+
+ grid[row][col] = 'x'
+ dfs(row + 1, col)
+ dfs(row - 1, col)
+ dfs(row, col - 1)
+ dfs(row, col + 1)
+
+ for i in range(len(grid)):
+ for j in range(len(grid[0])):
+ if grid[i][j] == LAND:
+ answer += 1
+ dfs(i, j)
+
+ return answer
+
+
+def num_island_bfs(grid) -> int:
+
+ LAND = '1'
+ answer = 0
+ queue = collections.deque()
+
+ def bfs(row, col, queue):
+
+ delta = [(1, 0), (0, 1), (-1, 0), (0, -1)]
+
+ while queue:
+ x, y = queue.popleft()
+
+ for dx, dy in delta:
+
+ px, py = x + dx, y + dy
+ if px < 0 or px >= len(grid) or py < 0 or py >= len(grid[0]) or grid[px][py] != LAND:
+ continue
+
+ grid[px][py] = 'x'
+ queue.append((px, py))
+
+
+ for i in range(len(grid)):
+ for j in range(len(grid[0])):
+
+ if grid[i][j] == LAND:
+ answer += 1
+ queue.append((i, j))
+ bfs(i, j, queue)
+
+
+ return answer
diff --git a/hash_objects/README.md b/hash_objects/README.md
new file mode 100644
index 0000000..dbb0bc4
--- /dev/null
+++ b/hash_objects/README.md
@@ -0,0 +1,298 @@
+## hash objects
+
+
+
+
+* hash tables (also known as hash maps) are data structure that organizes data using hash functions, in order to support quick insertion and search (map keys to buckets).
+
+
+
+
+
+
+
+
+
+
+
+
+
+