fn swap(mut yeezy: usize, mut slim_shady : usize, billboard: & mut[Node]) -> & mut [Node]{

	//If the requested swap is the first and last node, then simply swap them.
	if yeezy == 0 && slim_shady == billboard.len()-1 {
		billboard.swap(yeezy, slim_shady);
		billboard
	}
	//If the requested swap is anything else, then reverse all the nodes between the specified nodes inclusive.
	//1 2 3 4 5 6 7 8 9 10 and we want to swap edges between (3,4) and (8,9)
	//Then 3 will be followed by 8, and 4 will be followed by 9.
	//1 2 3 8 7 6 5 4 9 10
	else {
		while yeezy < slim_shady {
			billboard.swap(yeezy, slim_shady);
			yeezy += 1;
			slim_shady -= 1;
		}
		billboard
	}
}
//Swap edges
//The vector containing the path is passed as a mutable slice, and the modified slice is returned. 
Swap edges
The vector containing the path is passed as a mutable slice, and the modified slice is returned.
Swap edges The vector containing the path is passed as a mutable slice and the modified slice is returned .
fn swap(mut yeezy: usize, mut slim_shady : usize, billboard: & mut[Node]) -> & mut [Node]{
	//If the requested swap is the first and last node, then simply swap them.
	if yeezy == 0 && slim_shady == billboard.len()-1 {
		billboard.swap(yeezy, slim_shady);
		billboard
	}
	//If the requested swap is anything else, then reverse all the nodes between the specified nodes inclusive.
	//1 2 3 4 5 6 7 8 9 10 and we want to swap edges between (3,4) and (8,9)
	//Then 3 will be followed by 8, and 4 will be followed by 9.
	//1 2 3 8 7 6 5 4 9 10
	else {
		while yeezy < slim_shady {
			billboard.swap(yeezy, slim_shady);
			yeezy += 1;
			slim_shady -= 1;
		}
		billboard
	}
}
fn swap ( mut yeezy : usize , mut slim_shady : usize , billboard : & mut [ Node ] ) -> & mut [ Node ] { //If the requested swap is the first and last node, then simply swap them. if yeezy == 0 && slim_shady == billboard . len ( ) - 1 { billboard . swap ( yeezy , slim_shady ) ; billboard } //If the requested swap is anything else, then reverse all the nodes between the specified nodes inclusive. //1 2 3 4 5 6 7 8 9 10 and we want to swap edges between (3,4) and (8,9) //Then 3 will be followed by 8, and 4 will be followed by 9. //1 2 3 8 7 6 5 4 9 10 else { while yeezy < slim_shady { billboard . swap ( yeezy , slim_shady ) ; yeezy += 1 ; slim_shady -= 1 ; } billboard } }
Swap edges
The vector containing the path is passed as a mutable slice, and the modified slice is returned.
Swap edges The vector containing the path is passed as a mutable slice and the modified slice is returned .
yeezy
usize
slim_shady
usize
billboard
& mut[Node]
yeezy
usize
slim_shady
usize
billboard
& mut[Node]