<commit_before>#DIJKSTRA'S ALGORITHM
##COMPLEXITY :- O(v^2 + e) -> O(v^2)
* SINGLE SOURCE SHORTEST PATH
>	Input Weight-matrix w, w\[u\]\[v\]=Inf is there is no edge\(u,v\)\.
>	Input parent vector pa with initlized with 0\.
>	Output shortest distance dist from source\.
>	parent pa\[v\] of vertex v in shortest path to source\.

``` cpp
bool vst[MX];
int dist[MX];
int w[MX][MX];
int pa[MX];
vector<int> adj[MX]

class cmp
{
	bool operator () const (pii& v1,pii& v2)
	{
		return (v1.ss > v2.ss);
	}
};

void dijkstra(int source,int size)
{
	fill(vst,&vst[size],false);
	fill(dist,&dist[size],Inf);

	dist[source]=0;
	pa[source]=0; 

	priority_queue<int,vector<int>,cmp> Q;
	Q.push(mp(source,0));

	while(!Q.empty())
	{
		int u=Q.top().ff;
		Q.pop();
		if(vst[u]) continue;
		//use if(u==target) return dist[target]; for early return
		rep(i,adj[u])
		{
			int v=adj[u][i];
			if( dist[u] + w[u][v] < dist[v])
			{
				dist[v]=dist[u]+w[u][v];
				pa[v]=u;
				Q.push(mp(v,dist[v]));
			}
		}
	}
	return;
}

int print_path(int x) //  from source to v
{
	pi(pa[x]);pw;
	if(pa[x]==0) // 0 is parent of source
	{
		pn;return;
	}
	print_path(pa[x]);
	return;
}
```
<commit_msg>Small typo fix<commit_after>#DIJKSTRA'S ALGORITHM
##COMPLEXITY :- O(v^2 + e) -> O(v^2)
* SINGLE SOURCE SHORTEST PATH
>	Input Weight\-matrix w, w\[u\]\[v\]=Inf is there is no edge\(u,v\)\.
>	Input parent vector pa with initlized with 0\.
>	Output shortest distance dist from source\.
>	parent pa\[v\] of vertex v in shortest path to source\.

``` cpp
bool vst[MX];
int dist[MX];
int w[MX][MX];
int pa[MX];
vector<int> adj[MX]

class cmp
{
	bool operator () const (pii& v1,pii& v2)
	{
		return (v1.ss > v2.ss);
	}
};

void dijkstra(int source,int size)
{
	fill(vst,&vst[size],false);
	fill(dist,&dist[size],Inf);

	dist[source]=0;
	pa[source]=0; 

	priority_queue<int,vector<int>,cmp> Q;
	Q.push(mp(source,0));

	while(!Q.empty())
	{
		int u=Q.top().ff;
		Q.pop();
		if(vst[u]) continue;
		//use if(u==target) return dist[target]; for early return
		rep(i,adj[u])
		{
			int v=adj[u][i];
			if( dist[u] + w[u][v] < dist[v])
			{
				dist[v]=dist[u]+w[u][v];
				pa[v]=u;
				Q.push(mp(v,dist[v]));
			}
		}
	}
	return;
}

int print_path(int x) //  from source to v
{
	pi(pa[x]);pw;
	if(pa[x]==0) // 0 is parent of source
	{
		pn;return;
	}
	print_path(pa[x]);
	return;
}
```

{'fraction_non_alphanumeric': 0.2137372013651877, 'fraction_numerical': 0.010238907849829351, 'mean_word_length': 3.6161417322834644, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4515777', 'n_tokens_mistral': 1154, 'n_tokens_neox': 1061, 'n_words': 236}