5.7

Write afunction that performs base cJnversion. Specifically, the input
is an integer base b l, a string 5, representing an integer x in base b
l, and another integer base
b 2; the output is the string representing the integer x in base b 2•
Assume 2 ~ b l, b 2 ~ 16.
Use "A" to represent 10, "B" for 11, ... , and "F" for 15
5.6

Implement stringlinteger inter-conversion functions. Use the follow-
ingfunction signatures: String intToString(int ]C) and int
stringToInt(String
s)
5.5

Implement a method that takes as input a set S of distinct elements,
and prints the power set of S. Print the subsets one per line, with
elements separated by
commas
5.1

How would you go about computing tlte parity of a very large number
of 64-bit nonnegative intege
5.2

A 64-bit integer can be viewed as an array of 64 bits, with the bit at
index 0 corresponding to the least significant bi.t,and the bit at index
63corresponding to the
most significant bit. Implement code that tnJces as input a 64-bit
integer x and swaps the bits
at indices iand j
5.3

Write a function that takes a 64-bit integer x and returns a 64-bit
integer consisting of the bits of x in reverse orde
5.4

Suppose x E Sk, and k is not 0 or 64. How would you compute
y E Sk \ {x} such that Iy- xl is minimum?