Question: Problems: Write a piece of code that given an STL queue of strings, it will remove the strings that start with a digit (0-9) from

Problems: Write a piece of code that given an STL queue of strings, it will remove the strings that start with a digit (0-9) from the queue. The order of the remaining entries must be preserved. Also, write a function that will test if the contents of an STL queue of characters form a palindrome. A palindrome is a string that reads the same forward and backward (e.g. kayak, madam, dad).

Header:

Problems: Write a piece of code that given an STL queue of

template struct nodeType T data nodeType class myLL public: myLL(); //the default constructor void insert (T) //insert at the beginning of the list void print(); void inserts(T x); //insert x immediately before the first element that is bigger than x int getSize() { return size; } bool isEmpty() return head--nullptr;) bool remove(T) //remove the first occurrence of the specified element bool search (Tx); //returns true if x is in the list; void split(myLL &L1, myLL&L2); //splits the list into two lists L1 and L2 //where L1 is contains the first size/2 elements, // and the second list contains the rest of the elements //at the end of the operation the original list must be empty // e.g. if the original 1ist L-(21,1,12,34,56, /1 then after the operation L-, L1-(21,1,12), L2-(34,56) int numPosElements() //returns the number of elements for which the field data>e /ote this will only work for those list that the comparison data? is defined private: nodeType struct nodeType T data nodeType class myLL public: myLL(); //the default constructor void insert (T) //insert at the beginning of the list void print(); void inserts(T x); //insert x immediately before the first element that is bigger than x int getSize() { return size; } bool isEmpty() return head--nullptr;) bool remove(T) //remove the first occurrence of the specified element bool search (Tx); //returns true if x is in the list; void split(myLL &L1, myLL&L2); //splits the list into two lists L1 and L2 //where L1 is contains the first size/2 elements, // and the second list contains the rest of the elements //at the end of the operation the original list must be empty // e.g. if the original 1ist L-(21,1,12,34,56, /1 then after the operation L-, L1-(21,1,12), L2-(34,56) int numPosElements() //returns the number of elements for which the field data>e /ote this will only work for those list that the comparison data? is defined private: nodeType

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!