[Algorithm] Linked List to Integer (Tree/C++)

Changjin
Jan 16, 2021

--

Problem Link: https://binarysearch.com/problems/Linked-List-to-Integer

This question is to transform the given linked list representing the binary number into a decimal number. For example, 1->0->0 represents 4 in decimal. This is quite a simple question. Starting from the head node, we track of the res and multiply it by 2 and add the current value.

Linked List to Integer

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Changjin
Changjin

No responses yet