MCPcopy Create free account
hub / github.com/Ayush7614/Daily-Coding-DS-ALGO-Practice / huffmanencode

Method huffmanencode

Gfg/Java/Huffman Encoding.java:51–60  ·  view source on GitHub ↗
(Node root,String res)

Source from the content-addressed store, hash-verified

49 }
50
51 public static void huffmanencode(Node root,String res)
52 {
53 if(root.left==null&&root.right==null)
54 {
55 System.out.print(res+" ");
56 return;
57 }
58 huffmanencode(root.left,res+"0");
59 huffmanencode(root.right,res+"1");
60 }
61 public static class Node
62 {
63 String name;

Callers 1

encodeMethod · 0.95

Calls 1

printMethod · 0.45

Tested by

no test coverage detected