Saturday, November 9, 2019
George Washington’s Farewell Address
George Washington and Thomas Jefferson were the first and the third presidents of the United States, respectively and both were established presidents in their own ways. In George Washington's Farewell Address he advised Americans to not get entangled within foreign countries' problems and conflicts and to not have everlasting alliances and treaties. Washington also did not like the idea of having diverse political parties, and he also stressed the magnitude of religion and morality.Thomas Jefferson, in his first Inaugural Address states that a superior government ill be able to permit its citizens to be well mannered, but at the same time let them organize themselves in what they desire to do. Jefferson also says that all principles will never change. Although they were both highly respected and regarded to as some of the greatest presidents in American history they didn't always have the same opinions on what would be best for the growing nation.In his Farewell Address, George Wash ington mentions that Americans should mind American business and not be concerned with foreign conflicts because the United States had Just won a ery expensive war for their independence and already owed money to their new ally the French. This was a warning to all Americans because during that time America was still young, and it had many of its own problems to solve. Jefferson was also not in favor of getting involved with foreign entanglements.As Napoleon advanced into Europe, Jefferson decided to remain neutral in the conflict by banning all European trade from American Ports because of the British forces firing upon the Chesapeake. As harassment from Barbary pirates began to become an issue Washington was ersuaded to build up an American Navvy in order to protect those in harm and to retrieve the captured sailors. Thomas Jefferson's approach to the pirates was a little different from Washington's in that he chooses to implement a blockade of Tripoli and other Barbary ports in 1 801; these actions forced him to reconsider his advocacy of budget cuts for the American navy.These actions then allowed the American naw to become respected by the rest of the world, because it proved that they wouldn't be pushed around by anyone. Jefferson and Washington were both in favor of not etting involved in foreign entanglements as they showed through these actions and in their Addresses. George Washington specifically addressed the issue of diverse political parties. Washington thought political parties and political party dominance were very bad ideas.He wanted it to be about the best candidate being elected, not about two parties taking over and preventing all other parties from having an opportunity of being nominated. He said this because he believed it was dangerous to have power blocs arise from these different opinions. These different parties, the Democratic-Republicans and the Federalists were beginning to surface had different thought which in turn caused many h eated debates and a lot of aggression towards the opposite parties. However Jefferson knew that political parties were necessary, he voiced the thought in this famous quote.Jefferson said that there is basically no way to escape the differing opinions and political parties in a successful and free nation, due to the nature of man to disagree and to form their own opinions on how they think the nation should be run. Jetterson and his close triend James Madison organized the Democratic-Republican Party. Jefferson and Washington both had different opinions on the subject of political parties, with Washington strongly disapproving of it and Jefferson being a founder of one of the political parties it is safe to say they didn't share the same mindset on this topic.George Washington was instrumental in stressing the importance of morality and religion. In his Farewell Address Washington that through experience religious values in a government are important. This is referring to the succes sful European nations that have an established religion integrated into their government. Jefferson agreed hat religion was important for people to be able to express and to believe in freely, however Jefferson was very vocal in trying to solidify a position between the church and the state.He was himself a Christian man and placed several god-like statements in the Declaration of Independence. Washington disagreed with Jefferson on the separation of church and state however, they both agreed religion was important in the new nation. In both of their addresses they discussed the issues involving the new government such as the issue of making alliances with other nations or becoming involved in foreign entanglements.Both Washington and Jefferson agreed that for the nation to become successful they must keep away from any foreign affairs regarding the fact that the nation was still developing and if war was to occur it would leave them more susceptible to being taken over. Each of the highly regarded presidents discussed the formation of political parties. Washington thought that political parties would destroy the new system of government. Jefferson on the contrary knew that political parties were inevitable; he then went on, with another respected colleague James Madison, to create the Democratic-RepublicanParty. The subject of religion and morality was discussed greatly in this period of time. Washington believed that for the government to be successful religion must be involved in all of the important branches such as the court systems. Jefferson on the other hand wanted to create a ââ¬Å"wall of separation between church and state. â⬠Although both of the presidents were extremely instrumental in founding and establishing this great nation, they didn't always agree with each other, which isn't bad because to create a good story you must have all points of view.
Thursday, November 7, 2019
Byzantine Civilization of the Middle Ages
Byzantine Civilization of the Middle Ages In the fifth century AD, the mighty Roman Empire fell to invading barbarians and complex internal pressures. The land that had been centrally governed for centuries disintegrated into numerous warring states. The safety and privileges enjoyed by some residents of the empire vanished to be replaced by a constant state of danger and uncertainty; others merely traded one set of daily terrors for another. Europe was plunged into what Renaissance scholars would label a dark age. Yet Byzantium remained. The Empire of Byzantium was the eastern portion of the Roman Empire, which was divided in 395 A.D. Its capital of Constantinople, located on a peninsula, was naturally secure from invasion on three sides, and its fourth side was fortified with a network of three walls that withstood direct attack for over a thousand years. Its stable economy provided a strong military and, together with an abundant food supply and advanced civil engineering, a high standard of living. Christianity was firmly entrenched in Byzantium, and literacy was more widespread there than in any other nation in the middle ages. Although the predominant language was Greek, Latin was also fairly common, and at one point all seventy-two of the worlds known languages were represented in Constantinople. Intellectual and artistic endeavors thrived. This is not to say that the Byzantine Empire was an oasis of peace in the desert of the perilous middle ages. On the contrary, its long history is marked by numerous wars and remarkable internal strife. Its official borders expanded and shrank several times as its rulers attempted to restore the empire to its former glory or fought off invaders (or occasionally attempted both simultaneously). The penal system was so harsh as to be viewed by western crusaders no strangers to mutilation and other extreme measures in their own systems of justice as exceedingly cruel. Nevertheless, Byzantium remained the most stable nation of the middle ages. Its central location between western Europe and Asia not only enriched its economy and its culture but allowed it to serve as a barrier against aggressive barbarians from both areas. Its rich historiographical tradition (strongly influenced by the church) preserved ancient knowledge upon which splendid art, architecture, literature and technological achievements were built. It is not an altogether unfounded assumption that the Renaissance could not have flourished were it not for the groundwork laid in Byzantium. The exploration of Byzantine civilization is undeniably significant in the study of medieval world history. To ignore it would be akin to studying the classical era without considering the cultural phenomenon of ancient Greece. Unfortunately, much (but thankfully not all) historical investigation into the middle ages has done just that. Historians and students often focused on the fall of the Western Roman Empire and the numerous changes in Europe without ever once glancing at Byzantium. It was often mistakenly believed that the Byzantine Empire was a static state that had little impact on the rest of the medieval world. Fortunately, this view is changing, and a great wealth of information concerning Byzantine Studies has recently been produced much of it available on the net. Selective Byzantine TimelineHighlights from the dynastic history of the Eastern Roman Empire. Byzantine Studies IndexA multilevel directory of useful sites about the people, places, art, architecture, religious history, military history and general history of the Eastern Roman Empire. Also includes maps and useful resources for the professional. Suggested ReadingUseful and informative books about the Eastern Roman Empire, from general histories to biographies, art, militaria, and other fascinating topics. The Forgotten Empire is copyright à © 1997 by Melissa Snell and licensed to About.com. Permission is granted to reproduce this article for personal or classroom use only, provided that the URL is included. For reprint permission, please contact Melissa Snell.
Tuesday, November 5, 2019
Supreme Court Cases Dealing with Pornography
Supreme Court Cases Dealing with Pornography The Supreme Court has addressed pornography more often than almost any other issue of comparable specificity, and small wonder why- the Court has read an implicit obscenity exception to the free speech clause, giving it the unenviable responsibility of interpreting an unstated 18th-century definition of obscenity two centuries later. And the more the Court has attempted to define obscenity, the more complex that definition has become.The Supreme Court made things slightly easier for itself in three cases, all decided between 1967 and 1973.Jacobellis v. Ohio (1967)Forced to determine whether the art film Les Amants was obscene, despite the fact that it was obviously not intended to serve as pornography, the Court acknowledged the difficulty of its job- before ruling in favor of the film on multiple, vague grounds. Justice Potter Stewart memorably captured the Courts challenge: It is possible to read the Courts opinion in [past pornography cases] in a variety of ways. In saying this, I imply no criticism of the Court, which, in those cases, was faced with the task of trying to define what may be indefinable. I have reached the conclusion, which I think is confirmed at least by negative implication in the Courts [recent decisions] that, under the First and Fourteenth Amendments, criminal laws in this area are constitutionally limited to hard-core pornography. I shall not today attempt further to define the kinds of material I understand to be embraced within that shorthand description, and perhaps I could never succeed in intelligibly doing so. But I know it when I see it, and the motion picture involved in this case is not that. These are the rights that appellant is asserting in the case before us. He is asserting the right to read or observe what he pleases the right to satisfy his intellectual and emotional needs in the privacy of his own home. He is asserting the right to be free from state inquiry into the contents of his library. Georgia contends that appellant does not have these rights, that there are certain types of materials that the individual may not read or even possess. Georgia justifies this assertion by arguing that the films in the present case are obscene.But we think that mere categorization of these films as obscene is insufficient justification for such a drastic invasion of personal liberties guaranteed by the First and Fourteenth Amendments. Whatever may be the justifications for other statutes regulating obscenity, we do not think they reach into the privacy of ones own home. If the First Amendment means anything, it means that a State has no business telling a man, sitting alone in his own house, what books he may read or what films he may watch. Our whole constitutional heritage rebels at the thought of giving government the power to control mens minds. The difficulty is that we do not deal with constitutional terms, since obscenity is not mentioned in the Constitution or Bill of Rights â⬠¦ for there was no recognized exception to the free press at the time the Bill of Rights was adopted which treated obscene publications differently from other types of papers, magazines, and books â⬠¦ What shocks me may be sustenance for my neighbor. What causes one person to boil up in rage over one pamphlet or movie may reflect only his neurosis, not shared by others. We deal here with a regime of censorship which, if adopted, should be done by constitutional amendment after full debate by the people.Obscenity cases usually generate tremendous emotional outbursts. They have no business being in the courts. If a constitutional amendment authorized censorship, the censor would probably be an administrative agency. Then criminal prosecutions could follow as, if, and when publishers defied the censor and sold their literature. Under that regi me, a publisher would know when he was on dangerous ground. Under the present regime whether the old standards or the new ones are used the criminal law becomes a trap. In practice, all but the most harmful and exploitative forms of pornography have generally been decriminalized despite the Courts relative lack of clarity on this issue.
Saturday, November 2, 2019
Urban Sustainabiliy Essay Example | Topics and Well Written Essays - 1500 words
Urban Sustainabiliy - Essay Example Populations grow vertically because families stick together and find space to work and connect with people through wealth. Urban places have a better chance of growing horizontally than those places with poorer services who are growing vertically as each person in the block or family or cross-section investigated has to grow out on their own and wish selfishness for himself while growing up. Defining what an urban citizen needs is what every citizen in the world requires:clean air,natural beauty,less pollution and intoxication of natural resources,peace and quietude and simplicity of living and understanding life and people with less complicated structure of behaviour than that which is by the people of rural or countryside places. 'In the context of sustainable urban development, we discuss the assessment of residential environmental quality and the importance of considering inhabitants' perceptions of natural resources in urban areas. Two series of studies, conducted in Guildford (United Kingdom) and in Rome (Italy), addressed the correspondence, or contrast, between inhabitants' and experts' assessment of urban quality concerning two crucial natural resources: air quality and biodiversity. The Guildford study emphasized the accuracy of the assessment of urban air quality by experts and the public. The Rome study focused on the evaluative criteria employed by scientists and the public in assessing the quality of urban green spaces. The results from both studies shed more, albeit complex, light on the simple conventional wisdom about public versus expert understanding and assessment of environmental quality.' (1) This is true as scientists do not have themselves living under the pressure of the persons in need of the changes and challenges especially that their points of discussions could be more of a story than of a realistic impression of what goes on and what is the fact that results in such concerns and what they mean and what they impose on the people who live such conditions which could be fatal to their lives because there is no escaping it. Scientists speak for the purpose of being heard even though much of them speak to solve,but the point of differences resulting in both words of the inhabitants and experts is the realism of what the inhabitants speak of and in the semi-realism of what the experts speak of. As always,the words of inhabitants shown in expert's words leads to the fact and result that inhabitants speak out of emotions and not realization and realization of facts;that their perspectives of the problems is nave and unemploying reason and facilities to exert more effort t o bring thoughts and understanding of the nature of the problem to the person who really lives such an issue. It is like what a doctor's manner of trying to soothe the pain of a dying patient by telling them that they are going to be alright except that they just have to wait a while 'and see furthermore solutions to solve
Thursday, October 31, 2019
Should everyone allow to own gun Essay Example | Topics and Well Written Essays - 500 words
Should everyone allow to own gun - Essay Example The Founders knew that by ensuring the right to own arms, citizens would have the ability to protect themselves from that which might endanger their life, liberty or pursuit of happiness. This could include bodily protection from persons and animals or from an oppressive government that threatened the freedoms outlined in the Constitution. ââ¬Å"The Second Amendment reflects the foundersââ¬â¢ belief that an armed citizenry, called the ââ¬Ëgeneral militiaââ¬â¢ was a necessary precaution against tyranny by our own government and its armyâ⬠(Krouse, 2002). Most Americanââ¬â¢s agree that the Second Amendment does allow law-abiding citizens to own guns for protection and hunting. Gun ownership ranks high among these political ideologies and to attempt to ban all guns would make these feelings even stronger. To make the case for upholding the widely perceived ââ¬Ërightââ¬â¢ to bear arms by allowing rifles and shotguns of a certain length while banning handguns seems the sensible solution and a fight that could be won. This tact has proven effective in other countries such as Britain and many other European nations. Those countries that ban handgun use have a much lower homicide rate than does the U.S. (Reynolds, Caruth, 1992) In the year 2002, more than 3000 American children died as a result of guns, mostly handguns. Compare this with Britain where 19 children were killed by guns in 2005 and Japan where none were killed. Both if these countries have enacted strict gun control laws. The children of America are dying every day so that those who insist they have a right to own an arsenal of weapons and misconstrue the Constitution to justify this desire. (ââ¬Å"Statisticsâ⬠2005). Gun enthusiasts mimic the concept that more guns will lead to less violence, that if everyone were carrying a gun, criminals would be too scared to commit crimes. The more is less philosophy. This doesnââ¬â¢t square with reasonable logic or the facts.
Tuesday, October 29, 2019
Respondeat Superior Paper Assignment Example | Topics and Well Written Essays - 750 words
Respondeat Superior Paper - Assignment Example The significance of this doctrine is that it gives the injured party the chance to recover losses or damages incurred, by making the employer liable for all the injuries brought about by an employeeââ¬â¢s actions, provided that this employee is operating within the scope of employment. In this case stated, the surgeon has a vicarious liability for the patientââ¬â¢s death. It is very determinable that the nurse-anesthetistââ¬â¢s action led to the death of the patient. It is the nurse-anesthetist who had administered anesthesia without paying close attention to the patientââ¬â¢s oxygen intake. The nurse-anesthetistââ¬â¢s negligence also caused her to fail to detect the vital signs of lack of oxygen, until the patient reached the precipice of a cardiac arrest. This alone gives a very strong ground for a Respondeat Superior case. Some of the Respondeat Superior lawsuits include death, injury, or incomplete treatment. Like this case, most Respondeat Superior cases stem from an unintentional and unforeseen failure to detect or carry out an action. It is beyond gainsay that both the surgeon and the nurse-anesthetist did not intend to harm the patient, but their unforeseen failure caused the patientââ¬â¢s death. It is also imperative to note that the nurse-anesthetist was acting as an employee in the line of duty. ... The import is that the deceased patientââ¬â¢s family, as well as the plaintiff, will easily prove that the nurse-anesthetist is an employee of the surgeonââ¬â¢s institution. Similarly, all the acts she had carried out were part of the treatment. The administration of anesthesia was done to prepare the patient for surgical intervention. This will greatly help the plaintiff prove that the nurse-anesthetist erred within the scope of employment. In another wavelength, noting that vicarious liability entails strict secondary responsibility is also important in understanding the surgeonââ¬â¢s liability for the nurse-anesthetistââ¬â¢s actions. This aspect of secondary liability is brought about by the surgeon being superior to the nurse-anesthetist. It is because of this hierarchical relation between the surgeon and the nurse-anesthetist that not only makes the nurse-anesthetist to prepare the patient for the surgeonââ¬â¢s work, but also makes the surgeon responsible for all the acts executed by his subordinate, the nurse-anesthetist. Again, Lewis and Gardner (2000) divulge that the conditions that describe vicarious liability are very wide, thereby giving the surgeonââ¬â¢s culpability a wider threshold. Particularly, vicarious liability in Respondeat Superior broadly imputes responsibility on any third party, provided that the third party possesses the authority and duty of control. The gravity behind this development is that even if the plaintiff may not in the court of law identify the very nurse-anesthetist; yet, by adducing the results of the investigations, the plaintiff will have rendered the surgeon fully liable. Since the results
Sunday, October 27, 2019
Report on Critical Review of Binary Search Tree Algorithm
Report on Critical Review of Binary Search Tree Algorithm What is Binary Search Tree? Binary search tree (BST) is a dynamic data structure, which means that its size is only limited by amount of free memory in the computer and number of elements may differ during the program executed. BST has aComparableKey (and an associated value) for each. All elements in its left sub-tree are less-or-equal to the node (, and all the elements in its right sub-tree are greater than the node (>). Assumexbe a node in a binary search tree. Ifyis a node in the left sub-tree ofx,thenkey[y] [x].Ifyis a node in the right sub-tree ofx,thenkey[x] [y]. A main pro of binary search trees is fast searching. There are three type of binary search tree: Inorder traversal Preorder traversal Postorder traversal In inorder traversal, the left sub-tree of the given node is visited first, then the value at the given node is printed and then the right sub-tree of the given node is visited. This process is applied recursively all the node in the tree until either the left sub-tree is empty or the right sub tree is empty. Java code for inorder traversal: public void printInorder(){ printInOrderRec(root); System.out.println(); } /** * Helper method to recursively print the contents in an inorder way */ private void printInOrderRec(Node currRoot){ if ( currRoot == null ){ return; } printInOrderRec(currRoot.left); System.out.print(currRoot.value+, ); printInOrderRec(currRoot.right); } In preorder traversal, the value at the given node is printed first and then the left sub-tree of the given node is visited and then the right sub-tree of the given node is visited. This process is applied recursively all the node in the tree until either the left sub-tree is empty or the right sub tree is empty. Java code for preorder traversal: public void printPreorder() { printPreOrderRec(root); System.out.println(); } /** * Helper method to recursively print the contents in a Preorder way */ private void printPreOrderRec(Node currRoot) { if (currRoot == null) { return; } System.out.print(currRoot.value + , ); printPreOrderRec(currRoot.left); printPreOrderRec(currRoot.right); } In postorder traversal, the left sub-tree of the given node is traversed first, then the right sub-tree of the given node is traversed and then the value at the given node is printed. This process is applied recursively all the node in the tree until either the left sub-tree is empty or the right sub-tree is empty. Java code for postorder traversal: public void printPostorder() { printPostOrderRec(root); System.out.println(); } /** * Helper method to recursively print the contents in a Postorder way */ private void printPostOrderRec(Node currRoot) { if (currRoot == null) { return; } printPostOrderRec(currRoot.left); printPostOrderRec(currRoot.right); System.out.print(currRoot.value + , ); } Full code example for BST //Represents a node in the Binary Search Tree. class Node { //The value present in the node. public int value; //The reference to the left subtree. public Node left; //The reference to the right subtree. public Node right; public Node(int value) { this.value = value; } } //Represents the Binary Search Tree. class BinarySearchTree { //Refrence for the root of the tree. public Node root; public BinarySearchTree insert(int value) { Node node = new Node(value); if (root == null) { root = node; return this; } insertRec(root, node); return this; } private void insertRec(Node latestRoot, Node node) { if (latestRoot.value > node.value) { if (latestRoot.left == null) { latestRoot.left = node; return; } else { insertRec(latestRoot.left, node); } } else { if (latestRoot.right == null) { latestRoot.right = node; return; } else { insertRec(latestRoot.right, node); } } } //Returns the minimum value in the Binary Search Tree. public int findMinimum() { if (root == null) { return 0; } Node currNode = root; while (currNode.left != null) { currNode = currNode.left; } return currNode.value; } //Returns the maximum value in the Binary Search Tree public int findMaximum() { if (root == null) { return 0; } Node currNode = root; while (currNode.right != null) { currNode = currNode.right; } return currNode.value; } //Printing the contents of the tree in an inorder way. public void printInorder() { printInOrderRec(root); System.out.println(); } //Helper method to recursively print the contents in an inorder way private void printInOrderRec(Node currRoot) { if (currRoot == null) { return; } printInOrderRec(currRoot.left); System.out.print(currRoot.value + , ); printInOrderRec(currRoot.right); } //Printing the contents of the tree in a Preorder way. public void printPreorder() { printPreOrderRec(root); System.out.println(); } //Helper method to recursively print the contents in a Preorder way private void printPreOrderRec(Node currRoot) { if (currRoot == null) { return; } System.out.print(currRoot.value + , ); printPreOrderRec(currRoot.left); printPreOrderRec(currRoot.right); } //Printing the contents of the tree in a Postorder way. public void printPostorder() { printPostOrderRec(root); System.out.println(); } //Helper method to recursively print the contents in a Postorder way private void printPostOrderRec(Node currRoot) { if (currRoot == null) { return; } printPostOrderRec(currRoot.left); printPostOrderRec(currRoot.right); System.out.print(currRoot.value + , ); } } //Main method to run program. class BSTDemo { public static void main(String args []) { BinarySearchTree bst = new BinarySearchTree(); bst .insert(10) .insert(40) .insert(37) .insert(98) .insert(51) .insert(6) .insert(73) .insert(72) .insert(64) .insert(99) .insert(13) .insert(9); System.out.println(The Binary Search Tree Example); System.out.println(Inorder Traversal:); bst.printInorder(); System.out.println(Preorder Traversal:); bst.printPreorder(); System.out.println(Postorder Traversal:); bst.printPostorder(); System.out.println(); System.out.println(The minimum value in the BST: + bst.findMinimum()); System.out.println(The maximum value in the BST: + bst.findMaximum()); } } Output example Linear Search Algorithm Linear search, also known as sequential search, is a operation that checks every element in the list sequentially until the target element is found. The computational complexity for linear search isO(n),making it mostly much less efficient than binary searchO(log n).But when list items can be arranged in order from greatest to lowest and the possibility appear as geometric distribution (f (x)=(1-p) x-1p, x=1,2),then linear search can have the potential to be greatly faster than binary search. The worst case performance scenario for a linear search is that it needs to loop through the entire collection; either because the item is the last one, or because the item isnt found. In other words, if havingNitems in the collection, the worst case scenario to find an item isNiterations. This is known asO(N)using theBig O Notation. The speed of search grows linearly with the number of items within the collection. Linear searches dont require the collection to be sorted. Example java program to show linear search algorithm class LinearSearchDemo { public static int linearSearch(int[] array, int key) { int size = array.length; for(int i=0;i { if(array[i] == key) { return i; } } return -1; } public static void main(String a[]) { int[] array1= {66,42,1,99,59,53,16,21}; int searchKey = 99; System.out.println(Key +searchKey+ found at index: +linearSearch(array1, searchKey)); int[] array2= {460,129,128,994,632,807,777}; searchKey = 129; System.out.println(Key +searchKey+ found at index: +linearSearch(array2, searchKey)); } } Output example Why Linear Search? Alinear searchlooks down a list, one item at a time, without skipping. In complexity terms this is an O(n) search where the time taken to search the list gets bigger at the same rate as the list does. Binary searchtree when starts with the middle of a sorted list, and it see whether thats greater than or less than the value it looking for, which determines whether the value is in the first or second half of the list. Skip to the half way through the sub-list, and compare again. In complexity terms this is an O(log n) search where the number of search operations grows more slowly than the list does, because it is halving the search space with each operation. For example, suppose to search for U in an A-Z list of letter where index 0-25 and the target value at index 20. A linear search would ask: list[0] == U? False. list[1] == U? False. list[2] == U? False. list[3] == U? False. . .. â⬠¦ list[20] == U? True. Finished. The binary search would ask: Comparelist[12](M) with U: Smaller, look further on. (Range=13-25) Comparelist[19](T) with U: Smaller, look further on. (Range=20-25) Comparelist[22](W) with U: Bigger, look earlier. (Range=20-21) Comparelist[20](U) with U: Found it. Finished. Comparing the two: Binary search requires the input data to be sorted but linear search doesnt. Binary search requires anorderingcomparison but linear search only requires equality comparisons. Binary search has complexity O(log n) but linear search has complexity O(n). Binary search requires random access to the data but linear search only requires sequential access. (it means a linear search canstreamdata of arbitrary size) Divide and Conquer Algorithm Divide and conquer is a top-down technique for designing algorithms that consists of dividing the problem into smaller sub-problems hoping that the solutions of the sub-problems are easier to find and then composing the partial solutions into the solution of the original problem. Divide and conquer paradigm consists of following major phases: Divide Breaking the probleminto several sub-problems that are similar to the original problem but smaller in size. Conquer Solve the sub-problemrecursively (successively and independently). Combine these solutionsto sub-problems to create a solution to the original problem. The similarity with Binary Search Tree, it is a degenerate divide and conquer search algorithm but with no combine phase. It searches for akeyin asortedvector then returning theindexwhere the key was found or return -1 when not found. It also reduces the problem size by half each recursion. The algorithm definition: Divides sorted vector into 2 halves. The lower halves contain values less or equal the key and the higher half values greater than or equal the key. If the low index exceeds the high index the key is not in the vector. Compute the middle index of the vector. If the key equals the value at the middle of the vector, the index of the middle is returned If the key is less than the value at the middle of the vector, the lower half is searched If the key is greater than the value at the middle of the vector, the higher half is searched Only one of the halves is searched, reducing the problem size by half each time. Recursion Technique Recursionis a technique of solving problems that includes breaking down a problem into smaller and smaller sub-problems until get to a small enough problem that it can be solved trivially. Normally recursion includes a function calling itself. While it may not would appear to be much at first glance, recursion allow to write elegant solutions to problems that may otherwise be extremely hard to program. It is very similar with binary search tree that using divide and conquer technique which is breaking down problem into sub-problems. A binary search or half-interval search algorithm discover the position of a specified value within a sorted array. In each step, the algorithm compares the input key value with the key value of the middle element of the array. If the keys match, then a matching element has been found so its index is returned. Otherwise, if the looked key is less than the middle elements key, then the algorithm repeats its action on the sub-array to the left of the middle element or, if the input key is greater, on the sub-array to the right. If the remaining array to be searched is reduced to zero, then the key cannot be found in the array and a special Not found indication is returned. Every repetition eliminates half of the remaining possibilities. This makes binary searches very efficient even for large collections. Binary search requires a sorted collection. Additionally, binary searching can only be applied to a collection that allows random access (indexing). Worst case performance: O(log n) Best case performance: O(1) Recursion is utilized as a part in this algorithm because with each pass a new array is created by cutting the old one in half. The binary search procedure is then called recursively, this time on the new array. Commonly the arrays size is adjusted by manipulating a beginning and ending index. The algorithm exhibits a logarithmic order of growth because it essentially divides the problem domain in half with each pass. Conclusion The conclusion is there is never be the best approach to follow blindly, each of these algorithms has its pros and cons. So, if there is any scenario or problem, it should be analyze first and adopt one of these algorithms to find whatââ¬â¢s suit. REFERENCE Implement Binary search in java using divide and conquer technique. Java search algorithm programs. 2014. [ONLINE] Available at:http://java2novice.com/java-search-algorithms/binary-search/. [Accessed 26 October 2014]. Best searching algorithm | java coding algorithms. 2014 [ONLINE] Available at:http://tekmarathon.com/2012/10/05/best-searching-algorithm-2/. [Accessed 26 October 2014]. Linear Search. 2014.Linear Search. [ONLINE] Available at:http://algorithms.openmymind.net/search/linear.html. [Accessed 26 October 2014]. Java Recursion with examples. 2014. [ONLINE] Available at:http://danzig.jct.ac.il/java_class/recursion.html. [Accessed 26 October 2014]. Divide-and-Conquer Algorithms. 2014.Divide-and-Conquer Algorithms. [ONLINE] Available at:http://www.personal.kent.edu/~rmuhamma/Algorithms/MyAlgorithms/divide.htm. [Accessed 26 October 2014]. Binary Search Trees. 2014.Binary Search Trees. [ONLINE] Available at:http://pages.cs.wisc.edu/~vernon/cs367/notes/9.BST.html. [Accessed 27 October 2014]. Binary Trees . 2014.Binary Trees. [ONLINE] Available at:http://www.cs.cmu.edu/~adamchik/15-121/lectures/Trees/trees.html. [Accessed 27 October 2014]. Data structures Why is Binary Search a divide and conquer algorithm? Stack Overflow. 2014. [ONLINE] Available at:http://stackoverflow.com/questions/8850447/why-is-binary-search-a-divide-and-conquer-algorithm. [Accessed 27 October 2014].
Subscribe to:
Posts (Atom)