Java | JSP | JSF Answers

Questions: 4 418

Answers by our Experts: 3 943

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

alice and bob were buying chocolates.It was Alice turn today to buy Bob chocolates.Bob gives list A of N chocolates where A[i] denotes price of ith chocolate.Alice being on a tight budget asks Bob if he can remove a few chocolates.Bob allows him to remove some chocolate whose price is X(which Alice can decide).Please find the minimum amount alice has to pay today


1. (a)

What is Inheritance? Why is it important?

  (b)

Write down a simple program that resembles inheritance in java.



2. (a)

Explain different types of inheritance in java with necessary figures. Which of them are used only for class? Name them.



3. (a)

Write down the scenarios where fully qualified name should be used.  

  (c)

Write down the differences between abstract class and concrete class


4. (a)

Define Interface. Interface contains abstract methods. Then, why dont we write abstract before defining any interface?

  (c)

Write down the differences between class and interface.



Draw a binary search tree and AVL tree from the following traversals:

{15, 5, 20, 70, 3, 10, 60, 90, 16}

·        Convert Binary Search Tree into Binary Tree such that sum of all greater keys is added to every key and  Write a code in java to Convert Binary Search Tree drawn into Balanced Binary Search Tree·        


alice and bob were buying chocolates.It was Alice turn today to buy Bob chocolates.Bob gives list A of N chocolates where A[i] denotes price of ith chocolate.Alice being on a tight budget asks Bob if he can remove a few chocolates.Bob allows him to remove some chocolate whose price is X(which Alice can decide).Please find the minimum amount alice has to pay today.​

1



Explain why the scenario below fails to ensure the likelihood of error free code.

Situation: Sam has been organized about his code. He uses code hinting to help him write code faster, and uses the find and replace all function to

edit faster.


Alice and Bob were buying some chocolates. It was Alice's turn today to buy Bob chocolates. Bob gives Alice A of N chocolates where A[i] denotes price of ith chocolates. Bob allows him to remove some chocolates whose price is X



As information centers are progressively centered on energy efficiency, it gets to be imperative to create Low control usage of the different applications that run on them. Data or Information compression plays a basic part in information centers to reduce storage capacity and communication costs. This work pivot on building a Low control, High performance execution usage for canonical Huffman encoding.

 

Suppose given Letters I, Q, R, A, C, M, P, U, S with following frequencies.       

           

                                  Frequency Table

                       Character          Frequency       

                               I                          20                  

                                   Q                       11                 

                                   R                        8                    

                                   A                        12                  

                                   C                         49

                                   M                           10

                                    P                            5

                                    U                           5

                                    S                           33

                                                       

 A.    Create a Single Huffman tree to determine the Binary codes for each character.

B.     Encode the following secret message sequence using Huffman encoding scheme.

   “IQRACAMPUS”

C. Compress and encode the given Information using Huffman coding Scheme.

    “STAY HOME STAY SAFE”  

Mr. Akbar is senior software developer working on an ecommerce website he wants to add the following products on his website with following keys

Mouse 4614

Keyboard 5882

Cable 6713

Webcam 4409

Monitor 1825

To make searching better he asked his junior to find the 2 digit hash address of products by following techniques and share results with him 

a) Division method with m=97

b) Mid square method

c) Folding method without reversing

d) Folding method with reversing


Draw a binary search tree and AVL tree from the following traversals:

{15, 5, 20, 70, 3, 10, 60, 90, 16}

·        Delete 15 and re-draw both Binary Search Tree and AVL Tree drawn in given traversal.

·        Reverse path of Binary Search Tree drawn

·        Convert Binary Search Tree into Binary Tree such that sum of all greater keys is added to every key.

·        Write a code to Convert Binary Search Tree drawn into Balanced Binary Search Tree


Suppose a business person launches new cinema at Islamabad and ask his team to develop a ticket system for box office. He assigns some requirements about system that how should it work. The requirements are such a way that there are only '5' number of box office windows in the theatre. Each window can have at max '20' number of people waiting in line. To start with, only one window is opened. If the number of people waiting in line in that window exceeds 20, then the next window is opened and people can join the line in that window. Likewise, if both the first and second windows have n number of people waiting in each queue, then a third window is opened. This can go on until the maximum number of windows w is reached. Let us assume that once a window is opened it never closes. A new window is only opened if all open windows are full. Each person can buy only one ticket. So, the system should not allot more than one ticket per person. Let us assume that the system issues one ticket each across all open windows. When a ticket is issued, the count of the number of people in each open queue is reduced by 1.

When a new person has to join the queue, the system has to prompt him to join a queue such that they are issued a ticket as fast as possible. The system prompts the person based on these factors: o First it looks for an open window with the least number of people and prompts that window number. If more than one window has the least number of people, then the system can prompt the person to join the first window (smaller window ld) it encounters with the least number of people. If the queues of all open windows are full and a new window can be opened, then the new person is prompted to join the new queue for the new box office window. O If all queues for all windows are full, a corresponding message is displayed. That person need not be considered in the next iteration .After a queue is prompted to a person, the person or system cannot change the queue.

Implement the system based on above scenario in java using suitable data structure.



LATEST TUTORIALS
APPROVED BY CLIENTS