Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.01 KB | None | 0 0
  1. /*
  2. * data structure - organizing data into a structure
  3. * functions - add delete transfer
  4. * search, print
  5. * If she asks to create a class stack, a class queue, as functions know the functions
  6. * Add delete search print sort
  7. * how can we identfiy the private data structure (under private keyword)
  8. * what is an array (size, pointer to first)
  9. * stack - last in first out,
  10. * queue - first in first out
  11. * know at least what is data strucutre (stucturing data within memory)
  12. * how to add/remove data structure, search data structure
  13. * how to solve/sort data structure
  14. * sorting is also one kind of question which can be built in
  15. * where can stack be used and what is it?
  16. * basic operations: push, pop, peek
  17. * applications: infix, postfix, reverse a string, implement two stacks inan array, check for balanced parenthesis
  18. * What is a queue and how is it implemented?
  19. * enqueue, dequeue, front, rear
  20. *
  21. * Exam 2:
  22. * p1 stack: 40
  23. * -convert infix to postfix conversion using stack (by hand not prog) (5 pts)
  24. * - evaluation of postfix expression (by hand not prog) (5 pts)
  25. * - write a function on a stack ( 10 pts) - Use the stack functions, but write function to do this with stack
  26. * - write a function on a stack(10 pts)
  27. * - what is the output (10 pts)
  28. * //unless it changes whole function, won't penalize for curly brackets (do not trust this)
  29. * //look at stuff on geeksforgeeks
  30. * //dont spend forever on it, its 10 points
  31. * //check the examples on url on access
  32. * //focus on stuff everybody can do, but you need to know logic - have a solid background in logic
  33. * //example: add two numbers from two stacks, decide where to put the result
  34. * //example: reverse queue, union of two queues
  35. * //for whats the output: every time you see cout, cout it, unless its about content of stacks
  36.  
  37. *
  38. *
  39. * p2 queue: 40 //all queues: circular, priority
  40. * 1. what is the output of queue (10)//will be tricky, will give you queue, will play with remove/add, then give contents of queue
  41. * 2. whats inside the queue after running a code(10)
  42. * 3. write a function using queue(10)
  43. * 4. write a function using queue(10) //she doesn't seem to know if she will alter this question string to use abnormal functions
  44. * //direct function on queue: enque, deque, search, (have question on binary search, may change)
  45. * //may ask sorting, but not testing on sorting. Can use any sort.
  46. * //will not ask efficiency questions
  47. * //you can do linear search or binary search for sorts and stuff, dont need exactly insertion sort
  48. * //study insertion sort, she recommends
  49. * //probably linkedlists
  50. * //keep in mind as general: insertion sort, templates
  51. * //declare a queue, use head as front
  52. * //for example, write a function to print a queue
  53. * //if she gives you header, you have to use queue as template. in this case, since its not clear, you can do queue->front
  54. * //if you did queue.front, she would consider it right.
  55. * //if you write a function to get the front, which returns the first element, all correct
  56. * //try not to do a lot of lines
  57. * //queue is popular for interviews
  58. * //example questions: traversal ,reverse, etc. She is focusing on Questions not from class.
  59. * //difference between sorted and unsorted array, can stop with while if sorted
  60. * //otherwise forloop
  61. * //find smallest/largest in a (queue, stack, etc)
  62. * // heapsort is popular on interview question (??)
  63. * // linkedlist or arrays for stacks or queues,
  64. * //will send preassessment Sunday night
  65. * p3 recursion: 20 points
  66. *1 - implement function iteartively as recursion(5,5)
  67. * 2 - Like clicker quiz (5 points )(may be taken directly from clicker) (recursion in general, not stack or queue or stuff)
  68. * 3 - convert function interatively, recursively (5 points) (loop to recurs, other wy) (may involve queue/stack)
  69. * //easy question: how to print recusrively
  70. * //stack backwards, forward, queue back, forward
  71. * //search for number, traverse (print), if asked sorting do anything mainly insertion, templates
  72. * //data structure interview questions
  73. * //queue implementation using linked list
  74. * //ultimately if you have to traverse a queue as a linkedlist, you can. You have a pointer, rule says first end first out,
  75. * //try to write something to traverse
  76. * //try to find the next greater element in a queue
  77. * //previous and next in queue, sort it, 2nd from rear that kind of thing
  78. * //instead of taking n times, sort in decreasing order
  79. * //how do you approach it?
  80. * //can you find next greater in a stack
  81. * //sort it, put it in another array, only remove top at time
  82. * //don't panic, you can have your own idea
  83. * //respect definition of stack
  84. * //if you don't have to violate it, do it
  85. * aws: amazon web services, you create your website, queue for messages, queue for requests,
  86. * if you have a popular website, and he can't answer all of it, he has a timeline
  87. * if request is not answered in 4 days, drop message and answer other message
  88. * one queue, different type of messages, if message is informational, you don't have to do anything, then drop
  89. * if request, put it in another queue, goes to server, if this service is very long or doesn't have time after 4 days
  90. * circular queue, or put in another queue
  91. * if it takes more than a week, drop it completely and resubmit it
  92. * amazon web services
  93. * Amazon Simple Queue Service
  94. * exact order they are sent
  95. * create one queue, have timer for four days, type of message and message, and if informational, read and drop, if
  96. * request, executed. Highest priority versus long message are requests
  97. * Example: aws, one queue 2 types, message I, message R, assume every minute 3 messages,
  98. * After 4 hours, the untreated request enqueuer with highest priority
  99. * Mi, Mr, Mr, Mi, Mr, Mr, Mi,
  100. * At hour 4:
  101. * mr, mr, mi, mr, mr, mi (old queue), mr, mi, mi, mr
  102. * after 4 hours, if still in queue, we still get other request
  103. * remove them, put them at end of queue
  104. * after two hours, he finds out he never reached one of the big ones, he drops it completely, and asks user to resubmit
  105. *
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement