def init(): global l_list l_list = LinkedList() for i in range(0, 15): data = randint(1, 10) l_list.append_data(data)
def del_dup_ll(l_list): n_list = LinkedList() v_map = {} i_pin = l_list.head while i_pin != None: if v_map.has_key(i_pin.data) == False: n_list.append_data(i_pin.data) v_map[i_pin.data] = 'X' else: None i_pin = i_pin.link return n_list