Prove If C is a binary self-dual code, show that
every codeword has even weight. Furthermore, prove...
Prove If C is a binary self-dual code, show that
every codeword has even weight. Furthermore, prove if each row of
the generator matrix of C has weight
Write c code to determine if a binary number is even or odd. If
it is odd, it outputs 1, and if it is even, it outputs 0. It has to
be less than 12 operations. The operations have to be logical,
bitwise, and arithmetic.
Prove that every real number with a terminating binary representation (finite number of digits to the right of the binary point) also has a terminating decimal representation (finite number of digits to the right of the decimal point).
Prove that a binary tree that is not full cannot correspond to
an optimal prefix code. The proof should first consider a
prefix-free code C, whose corresponding binary tree T has some node
with only one child; show that one can transform T into another
binary tree T', whose corresponding code C' has smaller average
length and so is better than C. In your proof you need to indicate
the transformation from T into T' and explain why the code...
(IN C)
Write the code to manage a Binary Tree. Each node in the binary
tree includes an integer value and string. The binary tree is
sorted by the integer value. The functions include:
• Insert into the binary tree. This function will take in as
parameters: the root of the tree, the integer value, and the
string. Note that this function requires you to create the
node.
• Find a node by integer value: This function takes in two...
code in c++
using the code given add a hexadecimal to binary converter and
add a binary to hexadecimal converter
#include <iostream>
#include <string>
#include<cmath>
#include<string>
using namespace std;
int main()
{
string again;
do {
int userChoice;
cout << "Press 2 for Decimal to Binary"<< endl;
cout << "Press 1 for Binary to Decimal: ";
cin >> userChoice;
if (userChoice == 1)
{
long n;
cout << "enter binary number" << endl;
cin>>n;
int decnum=0, i=0, remainder;
while(n!=0)
{...