Unimart is offering a dhamaka offer. Terms and conditions to gain the offer as follows: Unimart will provide a shopping bag which you can carry W weight at maximum load. (If you try to load more than W weight then it will fall on the ground and you will lose the offer forever) Unimart has N < 10 products with weight w1, w2, w3...etc. You can get only 1 product for each item. Input: W N maximum weight and number of products. Find the set of products and their sum so that you can use the maximum weight of your bag capacity. N integers represent weight product P1, P2....Pn. Output: Print selected products set and the sum of these products. Sample Input: 10 4 8 9 2 4 20 4 10 7 4 5 90 8 23 10 1 7 2 3 4 5 Sample Output: 8 2 Sum: 10 10 5 4 Sum: 19 23 10 1 2 3 4 5 7 Sum: 55 Output product set sequence doesn't matter but you have to find the optimal sum of weight so that maximizes the profit.
Kids Plus is for 0 to 12 years. A caregiver is assigned to (Newborn, Infant, toddler, preschool primary). The record includes ● Child - Child ID, First Name, Last Name, Date of Birth, Gender, Address, parent/guardian ID, Section Assignment ● Parent- Guardian ID, First Name, Last Name, Address, Relationship, Telephone, email ● Caregiver - Caregiver ID, First Name, Last Name, Gender, Address, AgeRange, Section identified by a letter that assigns 2 employees and maximum of 9 children. create files for each category. allow user to ● AddRecord ● UpdateRecord; if no information tell the user "No info". ● DeleteRecord ASSIGN caregivers and children to section and don't exceededmaximum threshold. Generate reports: ● Listing all children showing ID, name, DOB, Gender, Address, section they are assigned. ● Listing all caregivers showing ID, name, DOB ● The parent/guardians and their child(ren) ● Section letter each caregiver and children is assigned
Write a program to traverse a tree in Inorder sequence without recursion
You have given a game board in 2D matrix format where ‘S’ is the start point and ‘E’ isthe end point. There is only a single path from ‘S’ to ‘E’. In this path you will be face 3 types of Vampires which are marked as ‘M’, ‘N’ and ‘O’. But to kill those vampires you need Blades. You will find 3 types of Blades on your way which are marked as ‘A’, ‘B’ and ‘C’. Use Blade ‘A’ to kill Vampire ‘M’, Blade ‘B’ to kill Vampire ‘N’ and Blade ‘C’ to kill Vampire ‘O’. You will have one chance to kill a vampire using a Blade. If you miss it, you will be killed by that vampire. For carrying those Blades you have given a Bag of size 100 which is initially empty. For speed attack this bag works as Last in first out order for accessing blades. Now simulate the game starting from ‘S’ for different game board input.
Implement a BST-Binary Search Tree (for integer numbers) that consists of following operations: (1) Insert (2) Tree minimum (3) Search (4) In-order traversal (5) Tree successor (6) Delete
Two brackets are considered to be a matched pair if an opening bracket (i.e., (, [, or { ) occurs to the left of a closing bracket (i.e., ), ], or }) of the exact same type. There are three types of matched pairs of brackets: [], {}, and (). A matching pair of brackets is not balanced if the set of brackets are not matched.
Write a program to determine whether the input sequence of brackets is balanced or not. If a string is balanced, it prints YES on a new line; otherwise, print NO on a new line.
Example:
Input: {[()]} and Output: YES
Input: {[(])} and Output: NO
Write a program to convert an infix expression into its equivalent prefix notation.
Write a program to convert an infix expression into its equivalent postfix notation
Write a menu-driven program to perform the following operations of a stack using a linked list by using suitable user-defined functions for each case.
a) Check if the stack is empty
b) Display the contents of stack
c) Push
d) Pop