Tag: C/C++ coding exercise
Given head which is a reference node to a singly-linked list. The value of each node in the linked list is either 0 or 1. The linked list holds …
Given a positive integer num, write a function which returns True if num is a perfect square else False. Note: Do not use any built-in library function such as …
Given an integer, check if its binary representation are containing the alternating bits. For example, 101, 10101, 1010 are binary numbers with alternative bits. But 1011, 1110 are not. …
Similar to Parity Sorting, the Index Parity Sorting can be applied to an array of integers that have equal number of even numbers and odd numbers. You are to …
Given a list of sorted array containing only lowercase letters, and a target letter, your task is to find the smallest letter in the list that is greater than …