diff --git a/graphs/graph_traversals.md b/graphs/graph_traversals.md index 7e4b2c1..a959041 100644 --- a/graphs/graph_traversals.md +++ b/graphs/graph_traversals.md @@ -73,6 +73,8 @@ def breadth_first_search(graph, start): **Example interview question using BFS:** +* [Clone an undirected graph](https://www.geeksforgeeks.org/clone-an-undirected-graph/) + **Runtime**: O(V + E) diff --git a/graphs/top_sort.md b/graphs/topological_sort.md similarity index 97% rename from graphs/top_sort.md rename to graphs/topological_sort.md index 3f9807b..3fdf8b4 100644 --- a/graphs/top_sort.md +++ b/graphs/topological_sort.md @@ -1,4 +1,4 @@ -## Introduction +## Introduction to Topological Sorting Aside from DFS and BFS, the most common graph concept that interviews will test is topological sorting. Topological sorting produces a linear ordering of nodes in a directed graph such that the direction of edges is respected. A **topological sort** is an ordering of nodes for a directed acyclic graph (DAG) such that for every directed edge _uv_ from vertex _u_ to vertex _v_, _u_ comes before _v_ in the ordering. diff --git a/hash_tables/hash_tables.md b/hash_tables/hash_tables.md index 33657cc..9bb3629 100644 --- a/hash_tables/hash_tables.md +++ b/hash_tables/hash_tables.md @@ -11,7 +11,8 @@ address_book.get("Bob") '111-222-3333' ``` -Hash tables are very efficient â“ their insertion, deletion, and get operations take, on average, constant time. +Hash tables are very efficient. Operations such as insertion, deletion, and get take, on average, constant time. + ## How it works: ### Hash Codes Internally,a hash table stores its values in an array. A special **hash function** is utilized to convert each key into a code, which is then converted into an index into the underlying array. This hash function has a hard requirement to return the same hash code for equal keys. diff --git a/strings_arrays/binary_search.md b/strings_arrays/binary_search.md index f1b64a9..840fa48 100644 --- a/strings_arrays/binary_search.md +++ b/strings_arrays/binary_search.md @@ -1,3 +1,5 @@ +### Introduction + Binary search is a technique for efficiently locating an element in a sorted list. Searching for an element can done naively in **O(n)** time by checking every element in the list, but binary search's optimization speeds it up to **O(log n)**. Binary search is a great tool to keep in mind for array problems. Algorithm