Learning Bridge And Spanning Tree Algorithms