Question: OUTPUT^^^^ Need answer in c++ 1) We would like to implement the abstract data type called Bag that keeps track of bag of blobs. A
OUTPUT^^^^
Need answer in c++
1) We would like to implement the abstract data type called Bag that keeps track of bag of blobs. A bag has a maximum size Msize and supports insert, delete, IsEmpty, IsFull, and constructor/destructor operations. Insert adds a new blob to the bag and Delete removes a blob from the bag. Assume blob is a record type. A bag of blobs can be implemented using an array A[1..Msize] of blob pointers. If there are k blobs in the bag then the entries A[1], ..., A[k] point to these blobs. The remaining entries of the array point to null. The method Insert (p: blob pointer) adds the blob pointed to by p to the bag that is not full and the method Delete (p: blob pointer) removes the blob pointed to by p from the bag. Each blob in the bag should have an integer field that indicates where it is in the array A.
2) answer in c++
A palindrome is a phrase that reads the same forward and backward (examples: racecar, radar, noon, or rats live on no evil star). By extension we call every string a palindrome that reads the same from left to right and from right to left. Develop a recursive algorithm that takes as input a string and decides whether the string is a palindrome. Implement your algorithm in the PalindromeChecker(String) method.
CH. Command Prompt C:\Users iran\Dropbox\chegg\java\bag of blob\Bag\src>javac BagTestMain.java C:\Users iran\Dropbox\chegg\java\bag of blob\Bag\src>java BagTestMain Initial Bag: [ null null null null null ] Bag after insert: [ null 1 null 3 4 ] Total blob:3 Bag after delete: [ null null null null 4 ] Total blob:1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
