Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a SplitStack( ) function that divides a sorted linked Stack S, which conta

ID: 3637855 • Letter: W

Question

Write a SplitStack( ) function that divides a sorted linked Stack
S, which contains Objects of Character, into two linked stacks (S1 and
S2) according to the key (keyItem), where S1 contains all the items of
Stack whose keys are less than or equal to item’s key (keyItem)and S2
contains all the items of Stack whose keys are greater than to item’s
key (keyItems).
void SplitStack (LStack S , LStack S1, LStack S2,Character keyItem)
Note: To compare two objects of Character, you can use the character
method compareTo() as follows:
Character c = new Character('a');
Character c1 = new Character('b');
int x = c.compareTo(c1);
// x will hold number < 0 if c < c1 alphabetically
// x will hold number > 0 if c > c1 alphabetically
// x will hold number = 0 if c = c1 alphabetically

Explanation / Answer

splitstack() { char s[],s1[],s2[],c; int x; pritf("entr the key); scanf("%c',& c); for(i=0;i
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote