Mall-Tarat Sakshi Contracto0 HackerRank Question - Binary x C Learning Path ← → Chackerrank.com/test/eifsidn6q35/questio

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Mall-Tarat Sakshi Contracto0 HackerRank Question - Binary x C Learning Path ← → Chackerrank.com/test/eifsidn6q35/questio

Post by answerhappygod »

Mall Tarat Sakshi Contracto0 Hackerrank Question Binary X C Learning Path Chackerrank Com Test Eifsidn6q35 Questio 1
Mall Tarat Sakshi Contracto0 Hackerrank Question Binary X C Learning Path Chackerrank Com Test Eifsidn6q35 Questio 1 (66.71 KiB) Viewed 46 times
solve in java 8 in 30 minutes
solve in java 8
Mall-Tarat Sakshi Contracto0 HackerRank Question - Binary x C Learning Path ← → Chackerrank.com/test/eifsidn6q35/questions/1ecgba45c Info C# 43m left BETA Can't read the text? Switch theme (7) 5. Binary Number in a Linked List ALL A binary number is represented as a series of Os and 7's. In this challenge, the series will be in the form of a singly-linked list. Each node instance, a LinkedListNode, has a value, data, and a pointer to the next node, next. Given a reference to the head of a singly-linked list, convert the binary number represented to a decimal number. Example Libertin Linked list corresponding to the binary. number (010011)[2] or (19)[10]. Function Description Complete the function getNumber in the editor below. getNumber has the following parameter(s): binary: reference to the head of a singly-linked list of binary digits Ⓒ 1 2 3 4 5 Autocomplete Ready Ⓒ ^/ public static long getNumber (SinglyLinkedListNode binary) { long res= 0; SinglyLinkedListNode a binary; while (a != null) { res (res<<1) + (a.data); a = a.next; } return res; Test Results Custom Input Compiled successfully. All available test cases passed Test case 9 Input (stdin) Test case 10 1 7 Test case 11 A 3 e 4 1 Test case 12 8 5 1 6 e Test case 13 8 7 92 93 94 95 96 97 98 99 100 101 102 103 (2) >> I 3 Ⓡ Line: 74 Col: Run Tests Submit Run as Custom Input | Download Run Code
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply