Questions: 11 448

Answers by our Experts: 10 707

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

Your task is to design Dynamic Array (Class).
Your class should work for one and two dimensional Arrays
The class should enable the user to perform the following tasks:
1) Create a dynamic array of size specified by the user. Use an integer to keep track of the
size
2) Ask the user for numbers to insert until the user presses -1. Insert each value in the array.
Create a new larger array when the array is full, copy all data to the new array, and release
the memory for the old array. Print the array after each insert.
3) Ask the user for any numbers to delete until the user presses -1. Find the index of the
entered value in the original array and then remove that index from the original array.
Stop when the array is empty or when the user presses -1. Keep on reducing the array size
and print the array after each removal.
4) Make sure to release any allocated memory not yet released.
Note: make class or classes for these and call the functions in main
Write some code segment that inserts a node immediately after the "current" node, as
depicted below:
linked list
current pointing to B
A
C
After inserting 1st node X in the Linked List :
NOw current pointing to X node after inserting
A
C
X
B
List before inserting Node with String "X" , Write the code it should be in executing, take
dummy data to insert data, run the code make sure there is no error
Write a SortedInsert() function which given a list that is sorted in increasing order, and a single
node, inserts the node into the correct sorted position in the list. Use Insert() function of task 1
allocates a new node to add to the list, SortedInsert() takes an existing node, and just rearranges
pointers to insert it into the list.
Consider two sorted linked lists L1 and L2, both containing integers in increasing order. Merge
these two lists into one list L3 such that L3 should also be sorted but in decreasing order. For
example L1 (1, 3, 5, 6) and L2 (2, 4, 8, 9) are merged into a list L3 (9, 8, 6, 5, 4, 3, 2, 1). We do
not know the size of lists L1 and L2. Add the function to Task 1.
The Linked List contains certain Nodes containing data of integer type, You cannot use any
other type of Array or data structure neither doubly Linked List. Use only singly linked list,
Implement a function which can reverse the List. Write down the code take dummy data to
test and take snap shot to show output paste it in document.
Task 1:
Complete the body of this function. You do not need to check the precondition. You
may use the stack template class
bool balanced(const char p[ ], size_t n)
// Precondition: p[0]...p[n-1] contains n characters, each of which
// is '(', ')', '{' or '}'.
// Postcondition: The function returns true if the characters form a
// sequence of correctly balanced parentheses with each '(' matching
// a ')' and each '{' matching a '}'. Note that a sequence such as
// ( { ) } is NOT balanced because when we draw lines to match the
// parentheses to their partners, the lines cross each other. On the
// other hand, ( { } ) and { ( ) } are both balanced.
Task2:
Consider following Linked List:
struct Node {
int data;
Node *next;
class LList {
public:
LList();
~LList();
private:
Node *head;
int size;
};
LList::LList () {
head = NULL;
size = 0;
}
Implement the destructor LList::~LList ().
Note: You can use same linked list used in Task 1 and Task 2.
Write code that performs all operations on doubly Linked List
Note:
1)use class or struct
2)no global declarations

Create a class student which stores name, roll number and age of a student. Derive a

class test from student class, which stores marks in 5 subjects. Input and display the

details of a student.Extend this program to include a class sports, which stores the marks in sports activity.

Derive the result class from the classes ‘test’ and ‘sports’. Calculate the total marks and

percentage of a student.


Create a class student which stores name, roll number and age of a student. Derive a

class test from student class, which stores marks in 5 subjects. Input and display the

details of a student.Extend this program to derive a class from result from class ‘test’ which includes

member function to calculate total marks and percentage of a student. Input the data for a

student and display its total marks and percentage.


The following program is supposed to allocate nodes, put them into a linked list, print them out and then destroy them. Fix the bugs in the program and rewrite the code. Your program should have complete implementation required to run the following function. Take dummy data execute it, take snap shot and paste it in the document. struct linkedList{ int number; linkedList* next; }; void AddNode() { linkedList* head=NULL; linkedList* current; for(int i=0;i<10;i++){ current = new linkedList; current->number = i; current.next = head; head = current; } while(head->next!=NULL){ cout << head->number << endl; current = head->next; delete current; head = current; } return 0; }


LATEST TUTORIALS
APPROVED BY CLIENTS