-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from snehautekar05/add-faq-tab
Add FAQ tab at the bottom of article template #25
- Loading branch information
Showing
10 changed files
with
188 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,4 +62,4 @@ | |
</div> | ||
</div> | ||
</body> | ||
</html> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,4 +56,4 @@ | |
</div> | ||
</div> | ||
</body> | ||
</html> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,4 +59,4 @@ | |
</div> | ||
</div> | ||
</body> | ||
</html> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,4 +64,4 @@ | |
</div> | ||
</div> | ||
</body> | ||
</html> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Q1: What is Binary Lifting? | ||
Binary Lifting is a technique used to find the Lowest Common Ancestor (LCA) of two nodes in a tree in logarithmic time. It preprocesses the tree to create a table of ancestors at different powers of two. | ||
|
||
Q2: How does Binary Lifting improve query time for LCA? | ||
Instead of checking all nodes, Binary Lifting allows for jumping directly to the 2^j th parent of a node, which reduces the query time to O(log N) after an initial O(N log N) preprocessing step. | ||
|
||
Q3: What is the time complexity for preprocessing the tree? | ||
The preprocessing of the tree takes O(N log N) time, where N is the number of nodes in the tree. | ||
|
||
Q4: What is the main limitation of Binary Lifting? | ||
Binary Lifting does not work efficiently for dynamic trees where nodes can be added or removed frequently, as it requires a complete reprocessing of the ancestor table. | ||
|
||
Q5: Can Binary Lifting be used in graphs other than trees? | ||
Binary Lifting is primarily designed for trees. However, it can be adapted for directed acyclic graphs (DAGs) under certain conditions but is not generally applicable to arbitrary graphs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Q1: What is Dijkstra's Algorithm? | ||
Dijkstra's Algorithm is a graph search algorithm that finds the shortest path from a starting node to all other nodes in a weighted graph. | ||
|
||
Q2: How does Dijkstra's Algorithm work? | ||
The algorithm initializes distances to infinity, sets the distance of the starting node to zero, and iteratively selects the node with the smallest known distance to update the distances of its neighbors. | ||
|
||
Q3: What is the time complexity of Dijkstra's Algorithm? | ||
The time complexity is O((V + E) log V), where V is the number of vertices and E is the number of edges in the graph. | ||
|
||
Q4: Can Dijkstra's Algorithm handle negative edge weights? | ||
No, Dijkstra's Algorithm does not work with graphs that have negative edge weights as it assumes that once a node's shortest path is found, it cannot be improved. | ||
|
||
Q5: What are the practical applications of Dijkstra's Algorithm? | ||
Dijkstra's Algorithm is commonly used in GPS systems, network routing protocols, and other applications requiring efficient pathfinding in graphs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Q1: What is Huffman Coding? | ||
Huffman Coding is a compression algorithm that assigns variable-length codes to input characters based on their frequencies. Characters that occur more frequently are assigned shorter codes, while less frequent characters receive longer codes. | ||
|
||
Q2: How does Huffman Coding minimize the cost of merging sticks? | ||
Huffman Coding minimizes the cost by always merging the two smallest sticks first. This strategy ensures that the larger lengths, which contribute more to the total cost, are added later in the process, thus reducing the overall merging cost. | ||
|
||
Q3: What role do binary trees play in Huffman Coding? | ||
In Huffman Coding, a binary tree is used to represent the codes. Each leaf node represents a character, and the path from the root to the leaf determines the character's binary representation (0s and 1s). | ||
|
||
Q4: Can Huffman Coding guarantee the shortest binary representation? | ||
Yes, Huffman Coding guarantees the shortest possible binary representation for a given set of characters and their frequencies, as long as the characters' bit representations do not prefix each other. | ||
|
||
Q5: What is the importance of prefix-free codes? | ||
Prefix-free codes ensure that no code is a prefix of another. This property is essential for uniquely decodable encoding; it prevents ambiguity when decoding the compressed data back into its original form. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Q1: How does DFS differ from BFS? | ||
DFS uses a depth-first approach, diving deep into a branch before exploring another, while BFS explores nodes level by level, using a queue structure. | ||
|
||
Q2: What is the time complexity of DFS? | ||
The time complexity of DFS is O(V + E), where V is the number of vertices and E is the number of edges in the graph. | ||
|
||
Q3: Can DFS be used to find connected components? | ||
Yes, DFS can be used to find connected components in a graph by performing DFS on each unvisited node and marking all reachable nodes from that starting node. | ||
|
||
Q4: What are the practical applications of DFS? | ||
DFS is used in topological sorting, finding strongly connected components, and solving maze problems. It’s also helpful in generating paths and in algorithms like finding bridges and articulation points. | ||
|
||
Q5: Does DFS guarantee the shortest path in an unweighted graph? | ||
No, DFS does not guarantee the shortest path in an unweighted graph. BFS is used to find the shortest path in such cases because it explores nodes level by level. |