Alkyl halides react with alcoholic #"KCN"# to form alkyl cyanides
#"KCN"# is an ionic compound. The nucleophile is the cyanide ion
#[:stackrel("-1") ("C")"≡N:"]^"-"#
The carbon atom is the nucleophile and the reaction is
#underbrace("RX")_color(red)("alkyl halide") + :stackrel("-")("C")"≡N:" stackrel("Δ"color(white)(m)) (→)underbrace("RCN")_color(red)("alkyl cyanide") + "X"^"-"#
Alkyl halides react with alcoholic silver cyanide to form alkyl isocyanides.
The electronegativity difference between #"Ag"# and #"C"# is so small that the #"Ag-C"# bond is over 90 % covalent.
The nucleophile is #"Ag-C≡N:"#.
The carbon atom is no longer available to act as a nucleophile, but the N atom can still attack the alkyl halide.
#underbrace("RX")_color(red)("alkyl halide") + "AgCN:" stackrel("Δ"color(white)(m)) (→)underbrace("RNC")_color(red)("alkyl isocyanide") + "AgX"#