Skip to content

Instantly share code, notes, and snippets.

View gourav3017's full-sized avatar

Gourav Jhanwar gourav3017

View GitHub Profile
@gourav3017
gourav3017 / check_link.py
Created February 23, 2018 23:32 — forked from hackerdem/check_link.py
A simple python script to check broken links of a wesite
@gourav3017
gourav3017 / crawl.py
Created February 23, 2018 18:50 — forked from codesaler/crawl.py
Python Web Crawler - jonhurlock
#!/usr/bin/env python
"""
Simple Indexer
=================================
Author: Jon Hurlock, October 2011
This script basically crawls a domain (not just a page) and
then extracts all links <a href=""></a>, and finds all links
on that domain it also is able extract different file types
@gourav3017
gourav3017 / README.md
Created February 14, 2018 09:15 — forked from cstrelioff/README.md
Python + Bayes -- example 3

A script that replicates all examples in my blog post on inferring probabilities using a Beta prior-- see bayes post for more information.

Run all the examples

    $ python ex003_bayes.py
@gourav3017
gourav3017 / dijkstra.py
Created January 25, 2018 14:54 — forked from potpath/dijkstra.py
Python implementation of Dijkstra's Algorithm using heapq
import heapq
from collections import defaultdict
class Graph:
def __init__(self, n):
self.nodes = set(range(n))
self.edges = defaultdict(list)
self.distances = {}
@gourav3017
gourav3017 / search.py
Created January 23, 2018 15:06 — forked from professormahi/search.py
UCS, BFS, and DFS Search in python
from queue import Queue, PriorityQueue
def bfs(graph, start, end):
"""
Compute DFS(Depth First Search) for a graph
:param graph: The given graph
:param start: Node to start BFS
:param end: Goal-node
"""
@gourav3017
gourav3017 / graphs.py
Created January 23, 2018 14:45 — forked from daveweber/graphs.py
Breadth First and Depth First Search in Python
def bfs(graph, start):
visited, queue = set(), [start]
while queue:
vertex = queue.pop(0)
if vertex not in visited:
visited.add(vertex)
queue.extend(graph[vertex] - visited)
return visited
@gourav3017
gourav3017 / gist:8d7ca7ce586a168562fbe648d14b4001
Created January 22, 2018 05:24 — forked from ptigas/gist:2820165
linked list implementation in python
class Node :
def __init__( self, data ) :
self.data = data
self.next = None
self.prev = None
class LinkedList :
def __init__( self ) :
self.head = None