Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

B. For larger datasets, a linear search may be inadequate or perhaps inefficient. What other search method can be employed to return the maximum number from a set of elements in an array. Explain your answer. [5 marks]


C. As the lead system engineer at AIT, you have been given raw data for hundred (100) students who sat for an entrance exam and you have been asked to write the pseudocode to summarize the results. For each student grade, it is written a “P” for pass and “F” for fail. Use indentation and line numbers to highlight the flow of the program:

Your pseudocode should address the following:

i. Prompt the user to enter each result one after the other

ii. Provide a count of the results of each type

iii. Summarize the results indicating the number that passed or failed

[5 marks]


A. A list data structure unlike stacks and queues ensure items are added and removed from any location within the list. This is useful for manipulating some forms of storage or processing requirements. a. Nodes in a list can be added in two ways. Using diagrams, explain the two (2) forms of adding a new node to an existing list. [4 marks]


b. Using diagrams, explain how the head pointer can be implemented in a single list such that it does not have to change during additions and deletions. Your resulting list should have five (5) regular nodes. [3 marks]


c. Provide the algorithm and supporting diagram for updating your list with a single node at the front of the List. Name the currently added node “Q”. Your resulting list will now have six (6) regular nodes. [3 marks]



A project that requires participants to provide algorithms for searching files in a given structure is taking place. As the lead engineer for your team, propose a model and its corresponding algorithm to efficiently traverse the presented folder structure. The algorithm should list each step in the process and the corresponding final order 


Create a stack of size M for storing integer data. Our task is to insert a node at position P = M/2. If P is a decimal number, then P can be rounded to the nearest integer.

Hint: A temporary stack can be used to store the data while inserting a new node. Use header file math.h and routine round(P), to round P to the nearest integer.

Multi Line Text.


Task 2: Test for Palindrome (recursive)

Write a function isPalindrom() that takes as input a C string and its size, and recursively tests whether it is a palindrome (a word or phrase which remains the same if reversed. e.g. radar, kayak etc). The function returns the Boolean data type which is either true or false. The required header “stdbool.h” has already been included in tasks.h.

The function has the following prototype:

bool isPalindrom(char * ptr_array, int size);

The recursive definition of a palindrome is:

The string is a palindrome if it has only one character or is an empty string.

The string is a palindrome if the first and the last characters are the same and the characters in between form a palindrome.


Task 1: Reverse a character string.

Write a function called str_rev() that takes a pointer to a string as input and reverses the string in-place (this change should be reflected in the original string that was passed to the function, not to a copy of the string). No library functions for string reversal should be used. The function should also return a pointer to the reversed string.

Function prototype is given below:

char * str_rev(char * str);


Write a function median_2d()that computes the median for a 2D numeric array (matrix). The inputs to the function are a pointer to the start of the array, and its dimensions (rows and cols). Your function should not modify the contents of the original matrix! The function prototype is given below.

float median_2d(float * ptr_array, int rows, int cols);


Write a function called str_rev() that takes a pointer to a string as input and reverses the string in-place (this change should be reflected in the original string that was passed to the function, not to a copy of the string). No library functions for string reversal should be used. The function should also return a pointer to the reversed string.

Function prototype is given below:

char * str_rev(char * str);


  1. Take integer input from user and store it in the form of 1) stacks 2) queues and 3) Linked list.
  2. Sort the data stored in 1) stack 2) queue and 3) linked list entered in part 1
  3. Take user input and insert the data at the respective position in the sorted 1) stack 2) queue and 3) linked list.

Take integer input from user and store it in the form of 1) stacks 2) queues and 3) Linked list.


LATEST TUTORIALS
APPROVED BY CLIENTS