{"id":349,"date":"2015-04-01T02:19:36","date_gmt":"2015-03-31T15:19:36","guid":{"rendered":"http:\/\/casestudyhelp.com\/sample-questions\/?p=349"},"modified":"2018-01-30T16:28:29","modified_gmt":"2018-01-30T05:28:29","slug":"data-structures-assignment-help","status":"publish","type":"post","link":"https:\/\/casestudyhelp.com\/sample-questions\/data-structures-assignment-help\/","title":{"rendered":"Data Structures Assignment Help"},"content":{"rendered":"<div data-canvas-width=\"140.76720000000006\">COSC 2007 \u00a0Data Structures II<\/div>\n<div data-canvas-width=\"140.76720000000006\">\n<div>2-3 Search Tree<\/div>\n<div>\n<div style=\"text-align: justify;\">2-3 trees are data structures commonly used to implement ordered lists of records(or\u00a0tables). A 2-3 tree is a tree satisfying the following requirements\uf0b7<\/div>\n<div style=\"text-align: justify;\">All internal nodes in the tree have either two or three children.<\/div>\n<div style=\"text-align: justify;\">\uf0b7<\/div>\n<div style=\"text-align: justify;\" data-canvas-width=\"344.46\">All leaves of the tree are at the same level.The\u00a02-3 tree\u00a0is also a search tree like the binary search tree, but this tree tries to solve the\u00a0problem of the\u00a0unbalanced tree\u00a0The following link is useful\u00a0to understand how 2-3 trees works:<\/div>\n<div data-canvas-width=\"344.46\">\n<div style=\"text-align: justify;\" data-canvas-width=\"196.09999999999997\">Java applet illustrating 2-3 trees.<\/div>\n<div style=\"text-align: justify;\" data-canvas-width=\"628.9399999999998\">Practice adding nodes to the tree and see how the structure of the tree changes<\/div>\n<div data-canvas-width=\"628.9399999999998\">\n<div style=\"text-align: justify;\" data-canvas-width=\"229.3\">For this assignment, you should write a Java\u00a0program that read numbers from a file(TwoThreeInsert.txt)\u00a0and store them in a 2-3 tree. The file name MUST be given as an\u00a0argument for the program.\u00a0Then your program should provide a menu to allow the user to\u00a0do the following:<\/div>\n<div data-canvas-width=\"229.3\">\n<div data-canvas-width=\"14.999999999999998\">1.insert a new number to the tree.<\/div>\n<div data-canvas-width=\"14.999999999999998\">2.print the tree in an ascending order.<\/div>\n<div data-canvas-width=\"14.999999999999998\">3.print the tree in a descending order.<\/div>\n<div data-canvas-width=\"14.999999999999998\">4.save the current tree to the file and exit.<\/div>\n<div data-canvas-width=\"14.999999999999998\">\n<div data-canvas-width=\"260.32\">Your program should handle all\u00a0cases, such as adding a number which already exists in\u00a0the tree<\/div>\n<div data-canvas-width=\"260.32\">Sample run example:<\/div>\n<div data-canvas-width=\"260.32\">\n<div data-canvas-width=\"20\">$&gt;<\/div>\n<div data-canvas-width=\"49.99999999999999\">java<\/div>\n<div data-canvas-width=\"249.99999999999997\">MyTree TwoThreeInsert.txt<\/div>\n<div data-canvas-width=\"359.99999999999994\">Loading the file and insert into a 2<\/div>\n<div>&#8211;<\/div>\n<div data-canvas-width=\"59.99999999999999\">3 tree<\/div>\n<div data-canvas-width=\"649.9999999999999\">1. insert 2. print ascending 3. print descending 4. save and exit<\/div>\n<div data-canvas-width=\"189.99999999999997\">Enter your choice:1<\/div>\n<div data-canvas-width=\"20\">En<\/div>\n<div data-canvas-width=\"150\">ter a number:23<\/div>\n<div data-canvas-width=\"160\">Number inserted.<\/div>\n<div data-canvas-width=\"649.9999999999999\">1. insert 2. print ascending 3. print descending 4. save and exit<\/div>\n<div data-canvas-width=\"189.99999999999997\">Enter your choice:1<\/div>\n<div data-canvas-width=\"169.99999999999997\">Enter a number:23<\/div>\n<div data-canvas-width=\"209.99999999999997\">Number already exist.<\/div>\n<div data-canvas-width=\"649.9999999999999\">1. insert 2. print ascending 3. print descending 4. save and exit<\/div>\n<div data-canvas-width=\"189.99999999999997\">Enter your choice:2<\/div>\n<div data-canvas-width=\"109.99999999999999\">2 3 5 7 9 1<\/div>\n<div data-canvas-width=\"99.99999999999999\">2 23 65 67<\/div>\n<div data-canvas-width=\"649.9999999999999\">1. insert 2. print ascending 3. print descending 4. save and exit<\/div>\n<div data-canvas-width=\"189.99999999999997\">Enter your choice:5<\/div>\n<div data-canvas-width=\"209.99999999999997\">67 65 23 12 9 7 5 3 2<\/div>\n<div data-canvas-width=\"649.9999999999999\">1. insert 2. print ascending 3. print descending 4. save and exit<\/div>\n<div data-canvas-width=\"189.99999999999997\">Enter your choice:5<\/div>\n<div data-canvas-width=\"189.99999999999997\">\n<div data-canvas-width=\"219.99999999999997\">File saved. exiting&#8230;<\/div>\n<div data-canvas-width=\"20\">$&gt;<\/div>\n<div data-canvas-width=\"20\">\n<div data-canvas-width=\"65.18\">Bonus (<\/div>\n<div>1<\/div>\n<div data-canvas-width=\"54.16\">marks<\/div>\n<div data-canvas-width=\"23.2\">):<\/div>\n<div data-canvas-width=\"61.32\">implem<\/div>\n<div data-canvas-width=\"95.79999999999998\">ent a delete<\/div>\n<div data-canvas-width=\"59.99999999999999\">method<\/div>\n<div data-canvas-width=\"334.76\">that allows the user to delete a node from<\/div>\n<div data-canvas-width=\"69.2\">the tree.<\/div>\n<div data-canvas-width=\"205.35999999999999\">To delete a node from a 2<\/div>\n<div>&#8211;<\/div>\n<div data-canvas-width=\"492.85999999999996\">3 tree is performed analogously. First the node is located and<\/div>\n<div data-canvas-width=\"118.18000000000002\">removed. Call<\/div>\n<div>p<\/div>\n<div data-canvas-width=\"487.05999999999983\">the parent of the removed node. If the number of children of<\/div>\n<div>p<\/div>\n<div data-canvas-width=\"31.58\">has<\/div>\n<div data-canvas-width=\"83.58\">decreased<\/div>\n<div data-canvas-width=\"277.29999999999995\">from three to two, the tree is still 2<\/div>\n<div>&#8211;<\/div>\n<div data-canvas-width=\"247.76\">3. If the number of children of<\/div>\n<div>p<\/div>\n<div data-canvas-width=\"31.58\">has<\/div>\n<div data-canvas-width=\"276.74000000000007\">decreased from two to one, merge<\/div>\n<div>p<\/div>\n<div data-canvas-width=\"368.3\">with one of its siblings, possibly reducing the<\/div>\n<div data-canvas-width=\"179.81999999999996\">number of children of<\/div>\n<div>p<\/div>\n<div data-canvas-width=\"144.34\">&#8216;s parent. Precede<\/div>\n<div data-canvas-width=\"94.34\">recursively<\/div>\n<div data-canvas-width=\"280.3\">, up to the root of the tree. If at the<\/div>\n<div data-canvas-width=\"28.8\">end<\/div>\n<div data-canvas-width=\"687.44\">deleting a root makes its child become root. For more details how delete should work<\/div>\n<div data-canvas-width=\"265.54\">look at the above java applet link<\/div>\n<div data-canvas-width=\"93.33999999999999\">and the text<\/div>\n<div>&#8211;<\/div>\n<div data-canvas-width=\"39.8\">book<\/div>\n<div data-canvas-width=\"10\">\n<div class=\"textLayer\">\n<div data-canvas-width=\"219.99999999999997\">File saved. exiting&#8230;<\/div>\n<div data-canvas-width=\"20\">$&gt;<\/div>\n<div data-canvas-width=\"65.18\">Bonus (<\/div>\n<div>1<\/div>\n<div data-canvas-width=\"54.16\">marks<\/div>\n<div data-canvas-width=\"23.2\">):<\/div>\n<div data-canvas-width=\"61.32\">implem<\/div>\n<div data-canvas-width=\"95.79999999999998\">ent a delete<\/div>\n<div data-canvas-width=\"59.99999999999999\">method<\/div>\n<div data-canvas-width=\"334.76\">that allows the user to delete a node from<\/div>\n<div data-canvas-width=\"69.2\">the tree.<\/div>\n<div data-canvas-width=\"205.35999999999999\">To delete a node from a 2<\/div>\n<div>&#8211;<\/div>\n<div data-canvas-width=\"492.85999999999996\">3 tree is performed analogously. First the node is located and<\/div>\n<div data-canvas-width=\"118.18000000000002\">removed. Call<\/div>\n<div>p<\/div>\n<div data-canvas-width=\"487.05999999999983\">the parent of the removed node. If the number of children of<\/div>\n<div>p<\/div>\n<div data-canvas-width=\"31.58\">has<\/div>\n<div data-canvas-width=\"83.58\">decreased<\/div>\n<div data-canvas-width=\"277.29999999999995\">from three to two, the tree is still 2<\/div>\n<div>&#8211;<\/div>\n<div data-canvas-width=\"247.76\">3. If the number of children of<\/div>\n<div>p<\/div>\n<div data-canvas-width=\"31.58\">has<\/div>\n<div data-canvas-width=\"276.74000000000007\">decreased from two to one, merge<\/div>\n<div>p<\/div>\n<div data-canvas-width=\"368.3\">with one of its siblings, possibly reducing the<\/div>\n<div data-canvas-width=\"179.81999999999996\">number of children of<\/div>\n<div>p<\/div>\n<div data-canvas-width=\"144.34\">&#8216;s parent. Precede<\/div>\n<div data-canvas-width=\"94.34\">recursively<\/div>\n<div data-canvas-width=\"280.3\">, up to the root of the tree. If at the<\/div>\n<div data-canvas-width=\"28.8\">end<\/div>\n<div data-canvas-width=\"687.44\">deleting a root makes its child become root. For more details how delete should work<\/div>\n<div data-canvas-width=\"265.54\">look at the above java applet link<\/div>\n<div data-canvas-width=\"93.33999999999999\">and the text<\/div>\n<div>&#8211;<\/div>\n<div data-canvas-width=\"39.8\">book<\/div>\n<div data-canvas-width=\"10\">.<\/div>\n<div data-canvas-width=\"114.30899999999998\">Submission<\/div>\n<div data-canvas-width=\"12.544866666666666\">:<\/div>\n<div>\uf0b7<\/div>\n<div data-canvas-width=\"534.5599999999998\">Hand in your complete Java source code; and a copy of the results<\/div>\n<div data-canvas-width=\"99.94879999999998\">after running<\/div>\n<div data-canvas-width=\"100.42719999999997\">your program<\/div>\n<div>(<\/div>\n<div data-canvas-width=\"146.01999999999998\">with the given file<\/div>\n<div data-canvas-width=\"128.76000000000005\">Two Three Insert<\/div>\n<div data-canvas-width=\"33.18\">.txt)<\/div>\n<div>\uf0b7<\/div>\n<div data-canvas-width=\"221.06000000000003\">Upload your source code to<\/div>\n<div data-canvas-width=\"42.28\">CMS<\/div>\n<div>\uf0b7<\/div>\n<div data-canvas-width=\"428.4399999999999\">Demonstrate your program to TA before\/on the due date<\/div>\n<div data-canvas-width=\"428.4399999999999\"><\/div>\n<div data-canvas-width=\"428.4399999999999\">\n<p style=\"text-align: center;\"><strong>To get answer chat with online assignment adviser<\/strong><\/p>\n<p style=\"text-align: justify;\" align=\"center\"><a title=\"hire best assignment experts online\" href=\"https:\/\/casestudyhelp.com\/MyOrder.php\"><img decoding=\"async\" src=\"https:\/\/casestudyhelp.com\/images\/hire-best-assignment-experts-online.gif\" alt=\"Hire Your Assignment Writing Expert for Collage\/University\" \/><\/a><\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<script type=\"text\/javascript\" charset=\"utf-8\" src=\"http:\/\/w.sharethis.com\/widget\/?wp=6.2.9\"><\/script>","protected":false},"excerpt":{"rendered":"<p>COSC 2007 \u00a0Data Structures II 2-3 Search Tree 2-3 trees are data structures commonly used to implement ordered lists of records(or\u00a0tables). A 2-3 tree is a tree satisfying the following requirements\uf0b7 All internal nodes in the tree have either two or three children. \uf0b7 All leaves of the tree are at the same level.The\u00a02-3 tree\u00a0is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[189],"tags":[193],"_links":{"self":[{"href":"https:\/\/casestudyhelp.com\/sample-questions\/wp-json\/wp\/v2\/posts\/349"}],"collection":[{"href":"https:\/\/casestudyhelp.com\/sample-questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/casestudyhelp.com\/sample-questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/casestudyhelp.com\/sample-questions\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/casestudyhelp.com\/sample-questions\/wp-json\/wp\/v2\/comments?post=349"}],"version-history":[{"count":2,"href":"https:\/\/casestudyhelp.com\/sample-questions\/wp-json\/wp\/v2\/posts\/349\/revisions"}],"predecessor-version":[{"id":2832,"href":"https:\/\/casestudyhelp.com\/sample-questions\/wp-json\/wp\/v2\/posts\/349\/revisions\/2832"}],"wp:attachment":[{"href":"https:\/\/casestudyhelp.com\/sample-questions\/wp-json\/wp\/v2\/media?parent=349"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/casestudyhelp.com\/sample-questions\/wp-json\/wp\/v2\/categories?post=349"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/casestudyhelp.com\/sample-questions\/wp-json\/wp\/v2\/tags?post=349"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}