SEOClerks

Code for school project (binary tree)

Code for school project (binary tree)

(1) Please implement a binary search tree and particular the following functions:
- Search for an item based on the key value (search)
- Introduction to some key element in the SDS (insert)
- Calculating height of the tree (height)
- Calculate amounts of the binary tree elements (size)

Of course, you can add additional auxiliary methods in class BinTree, where deemed necessary. The node of the binary tree will contain an integer number, a pointer to the left child and a pointer to the right child , and it will be materialized as a class name BinNode.

After this you will materialize a class named BinTreeApp, which will do the followings:
1. It will introduce the following sequence numbers 1, 2, 3, ... 50 in an empty binary tree and then calculates and prints the screen height of the tree.

2. It will introduce the following sequence numbers 30 , 20, 40 , 10, 45, 35 , 25, 9
8 ... 2, 1 in an empty binary tree and then calculates and prints in the screen the height of the tree.

3. It will introduce 200 random numbers from the interval [ 1,1000 ] in an empty binary tree and will print in the screen the contents of the tree, sorted in ascending order. Each random number will be imported only if it is not already in the tree. The method of classification should not be used by some auxiliary data structure , e.g. table.

4. It will introduce N random numbers from the interval [ 1100.000 ] on a blank
binary tree and calculates and prints the average number of comparisons ( between elements of the tree ) for insertion ( given that: average number of comparisons = total number of comparisons / N ). Then you select 1000 random numbers in the same interval [ 1100.000 ] do a search in each one, and calculate and print the average number of comparisons ( between elements of the tree ) made ??during the search.

5. Shall the above energy (4 ) for N = { 25.000 , 50.000 , 75.000 , 100.000 } and prints the corresponding measurements on the screen. Then you complete the a table with the measurements. The number refers to the number of data elements introduced in the tree (can be N or less , depending on whether you allow duplicates ).

+More will follow, after this is done+


Requirements

Knowledge of java


Skills Required

Programming Java

Bids

No bids made yet - be the first!

Bid On Listing

Bid On Listing Created 12 years ago in Programming

Other jobs by Isilwen

Order Now
Process Time: 0.1182861328125

Possible Duplicate queries found!
MatchCountSQLScript
SELECT * FROM wanttobuy A, categories_wanttobuy B, seoclerks.members C WHERE A.wantid='14813' AND A.category=B.CATID AND A.USERID=C.USERID1SELECT A.*, B.name, B.seo, C.username, C.userlevel, C.footer_code, C.rating, C.ratingcount, C.googleplus_profile, C.total_recommendations, C.USERID, C.profilepicture, C.average_response_time, C.lastlogin, C.addtime FROM wanttobuy A, categories_wanttobuy B, seoclerks.members C WHERE A.wantid='14813' AND A.category=B.CATID AND A.USERID=C.USERID

/opt/clerks-staging/docroot/viewwant.php 163 () ()

SELECT * FROM ratings_buyer WHERE USERID=44341SELECT sum(good) as thumbup, sum(bad) as thumbdown FROM ratings_buyer WHERE USERID=4434

/opt/clerks-staging/docroot/include/functions/main.php 19523 GetRatingsAsBuyerTotal() ()

SELECT * FROM wanttobuy A, categories_wanttobuy B WHERE A.wantid != 14813 AND A.category=B.CATID AND A.active=1 AND (A.tags like '%Programming Java%' ) LIMIT 41SELECT A.wantid, A.title, A.p1, A.maxprice, B.name, B.seo FROM wanttobuy A, categories_wanttobuy B WHERE A.wantid != 14813 AND A.category=B.CATID AND A.active=1 AND (A.tags like '%Programming Java%' ) LIMIT 4

/opt/clerks-staging/docroot/viewwant.php 551 () ()

SELECT * FROM wanttobuy A, categories_wanttobuy B WHERE A.wantid != 14813 AND A.category=B.CATID AND A.active=1 AND A.USERID=4434 LIMIT 41SELECT A.wantid, A.title, A.p1, A.maxprice, B.name, B.seo FROM wanttobuy A, categories_wanttobuy B WHERE A.wantid != 14813 AND A.category=B.CATID AND A.active=1 AND A.USERID=4434 LIMIT 4

/opt/clerks-staging/docroot/viewwant.php 568 () ()

SELECT * FROM wantcomments a, seoclerks.members b WHERE a.PID='14813' AND a.USERID=b.USERID and b.status='1' AND a.status=1 order by a.CID asc1SELECT a.comment, a.USERID, a.CID, a.time_added, a.istranslated, a.parentid, b.username, b.profilepicture FROM wantcomments a, seoclerks.members b WHERE a.PID='14813' AND a.USERID=b.USERID and b.status='1' AND a.status=1 order by a.CID asc

/opt/clerks-staging/docroot/viewwant.php 835 () ()

UPDATE wanttobuy SET viewcount = viewcount + 1 WHERE wantid='14813'1UPDATE wanttobuy SET viewcount = viewcount + 1 WHERE wantid='14813'

/opt/clerks-staging/docroot/include/functions/main.php 1729 update_wantviewcount() ()

SELECT * FROM wantbids as w, seoclerks.members AS m WHERE w.active=1 AND m.USERID=w.USERID AND m.status=1 AND w.USERID>0 AND w.wantid='14813' ORDER BY w.bidid ASC 1SELECT w.bidid, w.PID, w.comment, w.title, w.pricepublic, w.USERID, w.adjustedprice, w.ip, m.profilepicture FROM wantbids as w, seoclerks.members AS m WHERE w.active=1 AND m.USERID=w.USERID AND m.status=1 AND w.USERID>0 AND w.wantid='14813' ORDER BY w.bidid ASC

/opt/clerks-staging/docroot/viewwant.php 1192 () ()

SELECT * FROM categories_wanttobuy1SELECT * FROM categories_wanttobuy

/opt/clerks-staging/docroot/libraries/adodb5/adodb.inc.php 1899 CacheExecute() parseRedundantQueriesCache()

SELECT * FROM posts WHERE USERID=44341SELECT sum(positive_ratings) as thumbup, sum(negative_ratings) as thumbdown FROM posts WHERE USERID=4434

/opt/clerks-staging/docroot/libraries/adodb5/adodb.inc.php 1899 CacheExecute() GetBuyerRatingsTotal()

SELECT * FROM categories1SELECT * FROM categories

/opt/clerks-staging/docroot/libraries/adodb5/adodb.inc.php 1899 CacheExecute() parseRedundantQueriesCache()

select * from categories_software order by name asc1select * from categories_software order by name asc

/opt/clerks-staging/docroot/libraries/adodb5/adodb.inc.php 1899 CacheExecute() insert_GetSoftwareCategories()

select * from categories_wanttobuy order by name asc1select * from categories_wanttobuy order by name asc

/opt/clerks-staging/docroot/libraries/adodb5/adodb.inc.php 1899 CacheExecute() insert_get_wantcategories()

select * from categories_wanttotrade order by name asc1select * from categories_wanttotrade order by name asc

/opt/clerks-staging/docroot/libraries/adodb5/adodb.inc.php 1899 CacheExecute() insert_get_tradecategories()

SELECT * FROM seoclerks.members WHERE USERID='4434'1SELECT profile_data FROM seoclerks.members WHERE USERID='4434'

/opt/clerks-staging/docroot/include/functions/main.php 1927 getUserBackground() include()

Invalid SQL

count(*)sql1error_msg

Expensive SQL

Tuning the following SQL could reduce the server load substantially
LoadCountSQLMaxMin

Suspicious SQL

The following SQL have high average execution times
Avg TimeCountSQLMaxMin
0.0643241SELECT A.wantid, A.title, A.p1, A.maxprice, B.name, B.seo FROM wanttobuy A, categories_wanttobuy B WHERE A.wantid != 14813 AND A.category=B.CATID AND A.active=1 AND (A.tags like '%Programming Java%' ) LIMIT 40.0643240.064324