top of page
Search
  • jr229931hh1

Interior Stack Expansion for Integer Stacks

The following simple problem is an excellent for practicing working with stacks. Your goal is to create the function that takes two stacks st1 and st2 and one integer z. The function should expand the stack st1 by including the elements from st2. The entire st2 should be placed in the interior of st1 just before the first occurrence of the number z.







37 views0 comments

Recent Posts

See All

Evaluating formulas using stack

A stack can be used to evaluate formulas with brackets and operations +, -, and * on integers. The formula must have brackets around each of the operation. For example, the formulas "8" and "(1+7)" ar

Binary Search Trees Part 2

This post contains the program that tests the functions developed in https://jr229931hh1.wixsite.com/website/post/binary_search_tree City cFromInput(){ City ci; string n, c; int p; cout<<"Insert th

Binary Search Tree

The building block of the binary search tree is its node. template<typename T> struct BSTNode{ T storage; BSTNode* left; BSTNode* right; }; The component storage contains the relevant data. T

bottom of page