shah.sunil435
BAN USERTo design this app the list of classes we would need are these
1.User
2.Restaurant
3.Item
4.Menu
5.Order
6.Payment
7.Bill
8.Address
User class would have user information basic details
class User {
String UserId;
String Name;
Address Address;
String Mobile;
String Email;
}
Restaurant class would have its basic info and details of Menu available there
class Restaurant {
String ResturentId;
String Name;
Address Address;
String Mobile;
Menu Menu;
}
Menu class contains list of items available
class Menu {
String MenuId;
List<Item> VegItems;
List<Item> NonVegItems;
List<Item> Beverages;
}
Item class contains info about a particulat food
class Item {
String ItemId;
String Name;
decima Price;
}
Order class would have list of all selected food items as well as total price and delivery address
class Order {
String OrderId;
String OrderName;
List<Item> SelectedItems;
decimal TotalPrice;
Address deliveryAddress;
}
Payment class would have details about your order and payment type details
class Payment {
String PaymentId;
String OrderId;
PaymentType PaymentType;
String UserId;
}
class Bill {
String Id;
String UserId;
decimal TotalMoney;
PaymentType PaymentMethod;
}
1.Survey
2.User
User
----Name
----Mobile
----Email
---List<Survey>
Survey
----SurveyId
----CreatedDate
--------------------------------------------------------------------
----saveSurvey(String UserId, String surveyId)
----getAllSurvey()
----getSurvey(String surveyId)
There can be two cases
1.Where all given patterns are of equal length.
In this case the idea is maintain a hashMap where keys would be given patterns and value would be its count.Before streaming starts insert all keys in to the hashMap.Now maintain a queue of length of the pattern which stores the stream character,whenever a new character comes, add this to the queue and remove the character present at the front one.After this check if the value of the queue is present in the hashMap as a key or not and if its present increment by 1.
Case 2: When given patterns are of different size
Here maintain a buffer whose size is of longest pattern and at each character arrivals instead of checking whole buffer as key in hashMap check its all suffix as a key.
- shah.sunil435 November 25, 2017