Write a function that gets the pointer to the head

Assignment Help JAVA Programming
Reference no: EM133422710

Question 1. Write a C function with the following signature that gets three strings as input parameters: char* str, char* pattern and char* altPattern. Your function should searches for pattern in str and replaces all occurrences of pattern by altPattern and return the resulting string as its return value.

Please note that the function should not modify the content of the three char arrays passed to it as its input parameters while doing the mentioned task.

Hint: you may use malloc function to allocate memory for storing the string that your function returns.

char* findAndReplace(char* str, char* pattern, char* altPattern){

...

}

Question 2. Write a function that gets a variable of type int as its only input parameter and prints out the binary representation of the input integer. Our assumption is that the input parameter is always a non-negative integer.

Question 3. Given the following structure for node, write a function that gets the pointer to the head of a singly linked list (type: node*) as its only input parameter and returns the average of values stored in the list (return value type: double).

struct node{

int value;

struct node* next;

};

typedef struct node node;

Reference no: EM133422710

Questions Cloud

Does seeking a personal philosophy of the meaning of life : Does seeking a personal philosophy of the meaning of life - grappling with such questions as "How do I know that what I believe is true?"
What are the four stages of complete metamorphoses : What are the four stages of complete metamorphoses? Mealworms cause damage to farmers. What damage do they cause? Where are meal worms normally found?
Does the death with dignity law in oregon : Does the "death with dignity law in Oregon, which is discussed in the introduction of this chapter, have any provision to deal with cases such as these?
Differences between kaibab squirrels and abert squirrles : describe differences between Kaibab squirrels and Abert squirrels, and why it is thought that these differences have occurred.
Write a function that gets the pointer to the head : write a function that gets the pointer to the head of a singly linked list (type: node*) as its only input parameter and returns the average of values stored
Create a java program that declares and initializes : Create a Java program that declares and initializes two integer variables, "num1" and "num2", with values of your choice
What are the risks of using an open-source cryptographic : What are the risks of using an open-source cryptographic option as technology becomes more complex over time? Does it honestly make a difference
Why is the ethical review of research necessary : Why is the ethical review of research necessary? Why is this something for which researchers need outside help in the form of a research ethics board (REB)?
Create methods to add functionality to a linkedlist : Create methods to add functionality to a LinkedList. You will be implementing several different methods that require you to traverse

Reviews

Write a Review

JAVA Programming Questions & Answers

  Design a solution to the problem by using the five steps to

the software needs to allow the restaurant owner to schedule employees for up to 40 hours in a seven-day week. the

  Implement an iterative method with a for loop

Different scientists have developed Predator-Prey models to try to understand the interactions and foresee the evolution of the populations.

  Develop a reliable transfer protocol over udp

Develop a reliable transfer protocol over UDP. Focus on a Stop- and-Wait protocol.

  Create an application for kochs cottages

Create an application for Koch's Cottages, a weekend getaway resort that rents boats and cottages to use on the local lake.

  These test scores into an array and computes:

Write a program that reads these test scores into an array and computes:Sum of the test scores after dropping the minimum test scoreAverage of the test scores

  Write a script that inputs several lines of text

Write a script that inputs several lines of text and a search character and uses String method indexOf to determine the number of occurrences of the character in the text.

  Implementing dijkstras shortest-path algorithm

Implementing Dijkstras shortest-path algorithm - To improve efficiency of the program, you should add some caching to it

  Prepare demo program that implements all of above method

Specify, design, and implement a class that can be used in a program that simulates a combination lock.

  Word tree data structure problem

COMP 250: Introduction to Computer Science Assignment. Read the provided code including the comments which explain what the various methods do

  Integers as a parameter and returns the number

Write a method maxOccurrences that accepts a list of integers as a parameter and returns the number the number of times the most frequently occurring integer

  Run both c++ and java versions of your program

In C++, create an Exception class, and a DivideByZero sub-class that takes a string for its constructor, and use this in the try-catch mechanism. In Java, use the division by zero exception object.

  What balance will be stored

Let Account be the bank account class discussed. What balance will be stored in acct1, acct2, and acct3 after the following statements have been executed

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd