FarahNawar / Algorithm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Blog & Sites

Others

Proposition logic : De Morgan’s law: '(P and Q)' is logically equivalent to 'not (not P or not Q)'.

Graph

Graph Type

  • Directed - Undirected
  • Weighted - Unweighted
  • Complete Graph :
    • a complete graph is a simple undirected graph in which every pair of distinct vertices is connected by a unique edge Edges = n(n-1)/2
  • Regular Graph
  • Bipartite Graph
  • Complete Bipartite Graph
  • Subgraph

Terms

  • Node
  • Edge
  • Path : sequence of edges, Shortest Path
  • Degree : Indegree , Out degree
  • Handshaking lemma
    • in every finite undirected graph, the number of vertices that touch an odd number of edges is even.

Representation

  • Adjacency list
  • Adjacency matrix

Graph traversal

Graph traversal means visiting every vertex and edge exactly once in a well-defined order.

It includes

  • Visiting a vertex
  • Explorating a vertex

Traversing Algorithm

  • BFS
    • Finds shortest path to go from one node to another node
    • Only works for unweighted graph
    • BFS tree
    • Queue FIFO
  • DFS

Check whether a given graph is Bipartite or not

Shortest Path Algorithm

  • BFS ( for unweighted)
  • Bellman Ford
  • Dijkstra
    • Path relaxation
    • Works both on directed and undirected graph as long as the weight is non negative number
  • Floyed Warshal

Spanning Tree

Topological Sort

  • Scheduling task

About


Languages

Language:C++ 80.5%Language:C 19.5%