Advertisement
udaykumar1997

ffff

Feb 25th, 2017
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.19 KB | None | 0 0
  1. Q1.
  2.  
  3. Every algorithm needs a process in order to be created and utilized. Described below are the four stages of algorithm analysis and design:
  4.  
  5. Design....
  6.  
  7. The first stage is to identify the problem and thoroughly understand it. After you obtain the input, break out the problem into stages. All of this is elementary, but the same basic rules apply.
  8. This is also the point where you are going to use flowcharts and/or use pseudo code to work out the specific problems of solving the flow of operations within the code.
  9.  
  10. Analysation and Validation....
  11.  
  12. Once you have the basic framework of the algorithm it’s time to start analyzing how efficient the code is in solving the problem. Professional programmers usually prefer to examine it prior to writing the code and analyze results based on their expectations from the design stage.
  13. Either way, you're basically looking for the efficiency of the algorithm. Algorithms are measured in time and space for their efficiency. Look at the algorithm you’re designing and see how it works with different size data structures and what kind of time it takes to work through those structures.
  14.  
  15. Implementation....
  16.  
  17. Writing and coding the algorithm is the next step in the process. Write the code to execute quickly but can also handle the input data that it will receive.
  18.  
  19. Test ( Profiling and Debugging )....
  20.  
  21. Once the algorithm is designed and coded, go back and experiment with different variables in the algorithm. Experimentation in algorithmic design is really just another step of the analyzing of the algorithm. When you find flaws in what you have written or ways to write the code better, then go back to the design step and redesign the algorithm.
  22.  
  23. Circular Process of designing the algorithm....
  24.  
  25. The design and analysis of algorithms is a circular process. You may find yourself becoming involved in any one of the steps. An experiment on an existing algorithm might lead to a new design. Or a re-coding of an algorithm might lead to a more efficient execution. Wherever you find yourself, keep working towards the goal of efficiency of the algorithm.
  26.  
  27.  
  28.  
  29. Q4.
  30.  
  31. Dictionary :-
  32.  
  33. A dictionary is a set of items with a key attached to each item. Using the key, we can access, insert or delete the item quickly. Dictionary is a major data structure. Dictionaries differ from lists in that you can access items in a dictionary by a key rather than a position. There are many ways to implement a dictionary. The thing that is most important to notice right now is that the get item and set item operations on a dictionary are O(1). Another important dictionary operation is the contains operation. Checking to see whether a key is in the dictionary or not is also O(1).
  34.  
  35. ADT :-
  36.  
  37. An abstract data type (ADT) is a mathematical model for data types where a data type is defined by its behavior (semantics) from the point of view of a user of the data, specifically in terms of possible values, possible operations on data of this type, and the behavior of these operations. This contrasts with data structures, which are concrete representations of data, and are the point of view of an implementer, not a user.
  38.  
  39. Stable Algorithm :-
  40.  
  41. Sorting stability means that records with the same key retain their relative order before and after the sort.
  42. So stability matters if, and only if, the problem you're solving requires retention of that relative order.
  43. If you don't need stability, you can use a fast, memory-sipping algorithm from a library, like heapsort or quicksort, and forget about it.
  44. If you need stability, it's more complicated. Stable algorithms have higher big-O CPU and/or memory usage than unstable algorithms.
  45.  
  46. First-Child-Next-Sibling Representation of Trees :-
  47.  
  48. Usually, tree data structures are organised in a way that each node contains pointers to all its children.
  49. In a First-Child-Next-Sibling Representation of Trees that represents a multi-way tree T, each node corresponds to a node in T and has two pointers: one to the node's first child, and one to its next sibling in T. The children of a node thus form a singly-linked list.
  50.  
  51.  
  52.  
  53. Q5.
  54.  
  55. Some Important Problem Types Include...
  56. • Sorting
  57. • Searching
  58. • String processing
  59. • Graph problems
  60. • Combinatorial problems
  61. • Geometric problems
  62. • Numerical problems
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement