Ask Question, Ask an Expert


Ask C/C++ Expert

Home >> C/C++

problem1)a) Consider the function defined below

Int Compute( int X[ ], int n)
        If (n==1)
               return X[0];
                return X[n-1] + Compute(X, n-1);

If this function is called in the main program by the statement p = Compute(A, 5) ; where A is any array of integers, describe the process of execution. Finally what will be contained in p ?

b) How will you store the following sparse matrix in vector and linked list representation so that only nonzero elements are stored?

2321_Sparse matrix.jpg

c) prepare a statement or a set of statements to accomplish each of the following. Assume that all the manipulations occur in main and assume the following definitions

struct TTwenty

char Name[15];
Int Total _Runs;
struct TTwenty  *Next;
typedef struct TTwenty T20;
typedef T20 *ptr_T20;

i) Create a pointer to the start of the list called start_ptr . The list is empty.

ii) Create a node of type T 20 that is pointed to by pointer new_ptr of type ptr_T20. Assign the string“ Sachin ” to member Name and the value 96 to the member Total_Runs. Provide any  necessary declarations and statements.

iii) prepare a while loop that prints the data in each node of the list.1

problem2)a) prepare a program that computes the sum of the squares of the digits of an integer.

b) Consider the following declaration
typedef struct node
{ char Course_Grade;
Struct node *Next;
} Student;

For the above declaration, the following function displays the grades of a student in different courses.

Void Display_Grades(Student *S)
{ if (Is_Empty(S))
printf("The Stack is Empty!");
 printf("Printing the grades of courses..\n");
{     printf("%c\n",S->Course_Grade);
S = S->Next;

Does it display all the grades? If not, do the necessary modifications so that it displays all the grades. Also prepare the definition of the function Is_Empty ( ). Also prepare down the corresponding Push( ) and Pop( ) functions.

c) Manually provide the inorder, preorder and postorder traversals of the following binary search tree

456_Binary search tre.jpg

d) Draw a binary tree for the expression A*B-(C+D)*(P/Q)

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M92593
  • Price:- $100

Priced at Now at $100, Verified Solution

Have any Question? 

Related Questions in C/C++

Assignmentpart acomplete the following questionswrite c

Assignment Part A Complete the following questions: Write C++ code to open a document with the name Hello.txt, place the message "Hello, World!" in the document, and exit the document. Re open the file you closed, and re ...

Computer applications divisionassignment c programmingstl

COMPUTER APPLICATIONS DIVISION Assignment: C++ PROGRAMMING STL Vector For this assignment, you will be starting with an example program that demonstrates the use of a STL vector. In addition to this, you may need to look ...

Assignmentthis assignment gives you the opportunity to

Assignment This assignment gives you the opportunity to practice array of pointers, linked lists and self referential structures. Write a program that initializes two parallel arrays as follows: char * String[] = { "Abbi ...

Projectdecision statementsdirections read carefully and

Project: Decision Statements Directions (Read CAREFULLY and follow COMPLETELY): - Create the following programs in C++ that perform the purpose described and show the sample output (with user input where applicable). - I ...

Assignmentthis is the programthis program will use 2

Assignment This is the program: This program will use 2 different data structures to perform the same tasks; a vector and a dynamically sized array Write a complete C++ program that will: Declare a vector of integers wit ...

Assignmentoverviewthis assignment consists of implementing

Assignment Overview This assignment consists of implementing an application using the techniques learned in the first half of the course. Examples on how to use file operations, random number generation, the standard tem ...

Write a c application that does the followingitem 1 prompts

Write a C++ application that does the following: ITEM 1: Prompts the user to choose one of the following series: 1 + 1/2 + 1/3 + ... + 1/n ((((x * 2) * 2) * ...) * 2) series of n multiplications x + (x * 1) + (x * 2) + ( ...

Intro to programming in c assignmentsince this is the last

Intro to Programming in C Assignment Since this is the last assignment, there will be no late submission. All programs must be electronically submitted by 5:00pm on Tuesday, December 2nd with NO EXCEPTIONS in order to re ...

Intro to programming in c programming assignmentassignment

Intro to Programming in C Programming Assignment Assignment purpose: User defined functions, pointers, Menu driven program A Company needs to create software for their new line of phone applications. Customers will have ...

Programming in cbubba tubs bbq rub is a company that makes

Programming in C++ Bubba Tub's BBQ Rub is a company that makes different BBQ dry rubs and sauces. They make each product when it is ordered with the freshest ingredients and sell it by the unit. A unit is 2 ounces of pro ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

WalMart Identification of theory and critical discussion

Drawing on the prescribed text and/or relevant academic literature, produce a paper which discusses the nature of group

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro