Computer Science

Perform the following operations. Express your answer in Hexadecimal notation NOT( NOT(0xf00) OR NOT (0x084) ) 0xcdab + 0x4321

Perform the following operations. Express your answer in Hexadecimal notation NOT( NOT(0xf00) OR NOT (0x084) ) 0xcdab + 0x4321   EXPERT ANSWER To perform the given operations and express the answers in hexadecimal notation, let’s calculate each step: NOT(NOT(0xf00) OR NOT(0x084)): First, let’s find the negation of each operand: NOT(0xf00) = 0x0ff NOT(0x084) = 0xf7b …

Perform the following operations. Express your answer in Hexadecimal notation NOT( NOT(0xf00) OR NOT (0x084) ) 0xcdab + 0x4321 Read More »

The above Round Robin policy does not care about the process priority. In your homework, we will update our previous emulator to support preemptive Priotity algorithms.

The above Round Robin policy does not care about the process priority. In your homework, we will update our previous emulator to support preemptive Priotity algorithms.To achieve this goal, you have to complete these requirements:1. Include an additional priority field as the third column in the input.txt asdescribed below.2 40 7 12 4 24 1 …

The above Round Robin policy does not care about the process priority. In your homework, we will update our previous emulator to support preemptive Priotity algorithms. Read More »

You have network distributed into 10 sites and each site need at least a 100 computers, as a network you are requested to design the IP addresses by using private address. Answer the following: 1- What is the address class you will be used and the subnet mask 2- List the network addresses 3-List the range of computer addresses 4-List the broadcast address for each network

EXPERT ANSWER Answer:1. The default class of given address is B. The reason behind that is Class B IP Addresses range from 128.0.x.x to 191.255.x.x.2. The subnet mask is 255.255.0.0 because the default subnet mask for Class B is 255.255.x.x.3. The custom subnet mask is 255.255.2244. Total number of subnets needed are 2.

We are given an undirected graph G=(V,E) where the vertices are indexed from 0 to n−1 , i.e., we have V={0,1,…,n−1} . A global defensive alliance of G is a subset S⊆V , such that: – Any vertex in V\S is adjacent to at least one vertex in S – Any vertex in S is such that the number of its neighbors in S is larger than or equal to the number of its neighbors in V\S . The Minimum Global Defensive Alliance Problem (MGDA) is to determine a global defensive alliance of G of minimum cardinality. Question 4.1: Is S=V\{6} a feasible solution to MGDA? Is it an optimal solution? Question 4.2: State the decision problem associated with MGDA. Question 4.3: Prove that MGDA is a problem of the class NP. Question 4.4: Knowing that MGDA is NP-hard, does there exist a polynomial-time algorithm that solves it optimally? Question 4.5: Can we find an optimal algorithm to solve MGDA when G is a complete graph, i.e., there exists exactly one edge between any pair of vertices? Question 4.6: This is a bonus question (it is not mandatory, but can bring extra points). The text file next to the graph represents this graph. It gives the number of vertices, and the square binary matrix is the adjacency matrix of this graph. Write a Python program that can read such a text file, and that returns a Global Defensive Alliance with the smallest possible cardinality. Run your program on all the graphs given in the zip archive and display the best solution objective values in a table. Your algorithm should also be described in pseudo-code, and your strategy should also be explained in text.

EXPERT ANSWER

Implement the ID3 algorithm in C/C++ or Java. The program should ask the user to enter the name of the text file containing set of examples (training set) and other related data and should display the decision tree on screen as described below.

Implement the ID3 algorithm in C/C++ or Java. The program should ask the user to enter the name of the text file containing set of examples (training set) and other related data and should display the decision tree on screen as described below. Input text file format n //an integer representing number of attributes A1 m1//string …

Implement the ID3 algorithm in C/C++ or Java. The program should ask the user to enter the name of the text file containing set of examples (training set) and other related data and should display the decision tree on screen as described below. Read More »

Q1. Given that totient( 527 ) is 480 , what is 526 ∧ 959(mod527) ? Q2. You agreed to use a Caesar cipher with a key of k=5 with a friend. While sitting in a group, the friend hands you over a message that says “QNGWFWD”. Decrypt the message? Q3. Suppose you actually forgot the key. How many decryption computations of

EXPERT ANSWER Q.2: You agreed to use a Caesar cipher with a key of k = 5 with a friend. While sitting in a group, the friend hands you over a message that says “QNGWFWD”. Decrypt the message? Here, the encrypted text is “QNGWFWD” and value of the key is 5. So, we need to …

Q1. Given that totient( 527 ) is 480 , what is 526 ∧ 959(mod527) ? Q2. You agreed to use a Caesar cipher with a key of k=5 with a friend. While sitting in a group, the friend hands you over a message that says “QNGWFWD”. Decrypt the message? Q3. Suppose you actually forgot the key. How many decryption computations of Read More »

You are required to write a code that requires the user to consecutively enter non-negative integer numbers between 0 and 99999. Each entered number must be checked if it is plaindrome or not. A palindrome number reads the same forward as backward. For example, the numbers 22,898,5005 , and 19791 are plaindrome. The code must print the total count of plaindrome numbers entered by the user. The code must end when the user enters a number out of the allowed range (i.e. a negative number or a number greater than 99999). IMPORTANT NOTES – Do not add any cout statements except for the final answers as shown in the sample cases. Do not add “Enter a number”, “The total count of palindrome numbers is” or any similar prompts. – One-digit numbers are considered palindrome.

EXPERT ANSWER

Given the following structure that represents the building block of a binary tree. const int MAX_CHILD=2; struct Node\{ int index; int data; int child_count; int children[MAX_CHILD]; int color; // -1(uncolored), 1(White), 0 (Black) int bf; // balance factor fi: Write complete C program to do the following: 1. Implement a function to create two hinary search trees (RST) from a file already arranged to include BST. Use the following file (as an example) to construct each tree. 6 (count of nodes in tree) Index/data/count_child/ child0…/ initial-color 2. Implement an iterative function that returns the closest value in the constructed BST to an external double value. For example the closest value to the double value =13.67 is 14 . 3. Implement a function that computes the height of any given tree. 4. Implement a function that stores the balance factor (bf) for each node in any given tree. 5. Implement a function that takes two binary search trees as parameters. Your function should merge them using the following property: if two nodes are overlapped, then you should sum them in a new node, otherwise you should use the none NULL node as is. 6. You should test all functions in main.

EXPERT ANSWER

Implement the Linked List using head pointer only (you are not allowed to use tail pointer). Interface (abstract class) of LinkedList class is given below. Your task is to provide the complete implementation for this question (a child class having name myLL is required, this myLL class will provide the complete implementation of the LinkedList class)

C++ Implement the Linked List using head pointer only (you are not allowed to use tail pointer). Interface (abstract class) of LinkedList class is given below. Your task is to provide the complete implementation for this question (a child class having name myLL is required, this myLL class will provide the complete implementation of the …

Implement the Linked List using head pointer only (you are not allowed to use tail pointer). Interface (abstract class) of LinkedList class is given below. Your task is to provide the complete implementation for this question (a child class having name myLL is required, this myLL class will provide the complete implementation of the LinkedList class) Read More »

There are N cities, and you want to send trucks from your factory (in city 1) to the other cities, the taller the better. There are M two-way roads connecting pairs of cities. Each road has a maximum truck height, determined by bridges and tunnels along the way. For each city V , you want to work out the maximum height of a truck that can travel from city 1 to city V . You do not care about the length of the route, just the best height. Input Format The first line is “N M “, where N is the number cities, and M is the number of roads. Each of the next M lines is ” UVH ′′ . It describes a road between cities U and V , with max truck height H . Constraints All inputs are positive integers. 1≤N≤50000 1≤M≤200000 1≤U≤N 1≤V≤N 1≤H≤1000 ​

Sample Input 0 4 3 1 2 72 1 4 96 2 4 80 Sample Output 0 80 0 96 Explanation 0 The best path to city 2 is via city 4. There is no path to city 3. Sample Input 1 5 6 1 2 70 1 3 75 2 3 80 2 5 …

There are N cities, and you want to send trucks from your factory (in city 1) to the other cities, the taller the better. There are M two-way roads connecting pairs of cities. Each road has a maximum truck height, determined by bridges and tunnels along the way. For each city V , you want to work out the maximum height of a truck that can travel from city 1 to city V . You do not care about the length of the route, just the best height. Input Format The first line is “N M “, where N is the number cities, and M is the number of roads. Each of the next M lines is ” UVH ′′ . It describes a road between cities U and V , with max truck height H . Constraints All inputs are positive integers. 1≤N≤50000 1≤M≤200000 1≤U≤N 1≤V≤N 1≤H≤1000 ​ Read More »