Home » 1. The Code Which Is Elegant And Efficient In Terms Of Processing. Code Written

1. The Code Which Is Elegant And Efficient In Terms Of Processing. Code Written

1. The code which is elegant and efficient in terms of processing. Code written in bits and pieces where different actions are independently being performed is not considered as an efficient and elegant code. 2. The analytics which are unique and interesting. For this purpose, may be, you can combine different algorithms to produce a new one for diverse analytics 3. Overall unique code for the entire problem Show transcribed image text

Please Help Fill In This Code Below: #include #include #include #define SIZE 15 #define
Please help fill in this code below: #include #include #include #define SIZE 15 #define EMPTY 0 #define STONE 1 // TODO: Add any extra #defines here. void printMap(int map[SIZE][SIZE], int playerX); // TODO: Add any extra function prototypes here. int main (void) { // This line creates our 2D array called “map” and sets all // of the blocks in the map to EMPTY. int map[SIZE][SIZE] = {EMPTY}; // This line creates out playerX variable. The player starts in the // middle of the map, at position 7. int playerX = SIZE / 2; printf(“How many lines of stone? “); // TODO: Scan in the number of lines of blocks. printf(“Enter lines of stone:n”); // TODO: Scan in the lines of blocks. printMap(map, playerX); // TODO: Scan in commands until EOF. // After each command is processed, you should call printMap. return 0; } // Print out the contents of the map array. Then print out the player line // which will depends on the playerX variable. void printMap(int map[SIZE][SIZE], int playerX) { // Print values from the map array. int i = 0; while (i < SIZE) { int j = 0; while (j < SIZE) { printf("%d ", map[i][j]); j ; } printf("n"); i ; } // Print the player line. i = 0; while (i < playerX) { printf(" "); i ; } printf("Pn"); } Show transcribed image text Question 3. [2 Points] Use The Binary Search Tree In Prolog As Discussed In Transcribed Image Text from this QuestionQuestion 3. [2 points] Use the binary search tree in Prolog as discussed in class. Write a predicate commonGP (Ka, Kb, T, ST) which finds a common grand parent of keys Ka and Kb in the tree T. The predicate commonGP/4 must find the subtree ST such that the root of ST is the closest common ancestor of Ka and Kb when looking from Ka and Kb towards the root. Example queries: ?- tree3 (X), commonGP ( 58, 2020, X, Y). X = t (55, t(17, t(5, nil, nil), t(22, nil, nil)), t(71, t (58, nil, t(64, nil, nil)), t(2020, nil, nil))), Y = t (71, t (58, nil, t (64, nil, nil)), t (2020, nil, nil)) ?- tree3 (X), commonGP ( 5, 22, X, Y). X = t (55, t(17, t (5, nil, nil), t (22, nil, nil)), t(71, t (58, nil, t(64, nil, nil)), t (2020, nil, nil))), Y = t (17, t (5, nil, nil), t (22, nil, nil)). The definition of the tree is as follows: tree3 (X) :- X = t (55, t(17,t(5,nil,nil), t (22, nil, nil)), t(71, t(58, nil, t (64,nil, nil)), t(2020, nil, nil))). 2. Suppose We Want To Implement Queue As A Stack. One Way To Do Transcribed Image Text from this Question2. Suppose we want to implement queue as a stack. One way to do is that use two stacks Si and S2. To insert into queue, we push into Sj. To remove from the queue we first check if S2 is empty, and if so, we “dump” Si into S2 (i.e., we pop each element from S, and push it onto S2). Then only we pop from $2. For instance, we perform INSERT(10), INSERT(20), DELETE(), the results are: At start Si=1 S2 = [] INSERT (10) Si = [10] S2 = [1] INSERT (20) Si = [2010] S2 = [] DELETE() S = [1 S2 = [10 20] “dump” Si = [] S2 = [20] “pop” (return 10) Consider each push and pop costs lunit of work. When performing a dump i.e. Si has n elements, costs 2n units (here we perform n pushes and n pops). a) Let us consider (empty queue) we perform 3 insertions, then 2 removals, then 3 insertions, and then 2 removals. Find the total cost of these series of operations. Also, find how many elements are in each stack at the end ? b) Let us consider that we perform an arbitrary sequence of insertions and removals, starting from an empty queue. What is the amortized cost of each operation? Give as tight of an upper bound as you can. Use the accounting method to prove your answer. The charge $x for insertion and $y for deletion. What are x and y? Write A Recursive Function OddFivesInOctal Which Takes A Number (Decimal) As Argument And Returns Computer Science Assignment Writing ServiceTranscribed Image Text from this QuestionWrite a recursive function oddFivesInOctal which takes a number (Decimal) as argument and returns whether octal representation of that number has odd number of digit 5 or not? You are not allowed to use if or if-else statement outside this function. bool oddFivesInOctal(int n){ //your code } oddFivesinOctal(45) should return false because octal representation of 45 is 55 and there are two occurrences of digit 5 in 55. Two is not odd. oddFivesinOctal(46) should return true because octal representation of 46 is 56 and there is one digit 5 in 56. One is odd. oddFivesinOctal(2605) should return true because octal representation of 2605 is 5055 and there are three occurrences of digit 5 in 5055. Three is odd. Question 4. [4 Points) A Solitary Game Asks To Place Buttons On A Checker Transcribed Image Text from this QuestionQuestion 4. [4 points) A solitary game asks to place buttons on a checker board of varying size. The game starts with a number in each square of the board. The player wins the game if the buttons are placed such that for each square, the total number of buttons in the rows and column of the square are the same as the number in the square. Simple 3×3 Example: 2 1 2 3 2 2 2 2 2 2 b 1 2 b 1 3 2 3 2 3 2 1 3 a a نيا с 2 с Your solution must work with any size of grid but you don’t have to optimize for speed. Your predicate buttons must take two input parameter: a list of number assignments and a list of button placements. If there is more than one solution, all solutions need to be found. ?- buttons ([(a,1,2), (a,2,2), (a,3,2), (b,1,1), (1,2,3), (6,3,2), (c,1,3), (c,2,2), (c,3,1)), X). X = [(a,2), (b, 1), (c,2), (0,3)] Use an intermediate predicate testsquare that is true if a placement of buttons satisfies the specification ?- test Square ( (a,1,2), [(a,2), (b,1), (0,2), (0,3) ]). true. 1. Redis Strings Greet Your Friend Install Redis: – Select Run->Install Start Redis Server:
1. Redis Strings Greet Your Friend Install Redis: – Select Run->Install Start Redis Server: – Select Run->Run Now in terminal type redis-cli The above will open a Redis prompt as below : redis> In the above prompt, type “PING” command and you will get “PONG” back in the terminal. Now you have – successfully installed Redis server. – started redis. – is in the Redis command line interface. There is a website of name Greet your friend which displays the wishes depending on the name you are giving. The name Anette reigh wants to be displayed on the page. Set the key as currentuser and set the value as Anette Riegha using strings. Write the query to get the output as Reigha using getrange. Write command to set the name as Allen Chiv to the key currentuser and get the output as the name which is the previous user name. Hint: Use getset You got an idea to automatically remove the user from the page every 1 minute Write command to set the user name as Sebastain using the key name checking with the help of sets. After inserting the key make it available for only 1 minute after that it should expire. Check Time to Live(TTL) of the key checking key using TTL command. TTL returns the remaining time in seconds basically the negative value indicates the key got expired. A new user of name Elsie has to be updated on the web page with the key name as newuser Using set command write command to insert the name of the user with the key as newuser. After inserting the user, there is a change with the name, the last name is not added. To modify it, Write command to append the name Moore to the original name Elsie. So, that the Full name is “Elsie Moore”. After modifying, write the command to get the value of newuser. Note: Before running the tests, make sure that your ttl of checking got expired. Git Instructions Use the following commands to work with this project Run Copy redis-server –daemonize yes; Test Copy bash .score.sh Install Copy bash .install.sh

2. Chef: System-Cleanup System Clean Up This Cookbook Should : – Delete ~/.cache Folder
2. Chef: System-Cleanup System Clean up This cookbook should : – Delete ~/.cache folder contents – Delete apt-cache (cached .deb files) – Remove unused dependencies using the command autoremove – List the directories/files occupying more space in a given directory. Get the directory path using attributes. – Delete the files in a given directory with mtime < 7 days. Get the directory path using attributes. – To run this cookbook in local mode use the command `sudo chef-client -z -o `. Git Instructions Use the following commands to work with this project Run Copy cd system_cleanup/cookbooks/; sudo chef-client -z -o cleanup; Test Copy bash .score.sh Install Copy bash .install.sh C Program Consider A Photo Studio Company That Provides Professional Photography Services. To Target c program Consider a Photo studio company that provides professional photography services. To target the skills required in different domains, the company hires several kinds of photographers such as 1) Product Photographer, 2) Art Photographer, and 3) Fashion Photographer. To design and implements this system, implement 3 Classes (as shown in below Figure) which represent the specific photographer type as mentioned above, and the 4th Class (named “Photographer”) an abstract class representing a collection of common attributes and function related to all the other 3 concrete classes. The Photographer class should contain name and remuneration (a double type value for storing service charges). Moreover, the functions provided by the Photographer class are getName (returns name of the photographer), calRemuneration (calculates the remuneration and stores into remuneration data-item), getRemuneration (returns the remuneration value), and a parameterized constructor. The ProductPhotographer class (a kind of Photographer) contains the attributes productType (name of a product) and nProducts (the number of products for which the photography services was done). Moreover, the class provides its own implementation of calRemuneration and getRemuneration functions and a parameterized constructor. The remuneration of a product photographer is calculated using 3000 Rs per product. The ArtPhotographer class (a kind of Photographer) contains attributes artType (name of the art type) and nHours (number of hours the photography services was provided). Moreover, the class provides its own implementation of calRemuneration and getRemuneration functions, and a parameterized constructor. The art photographer charges for his services at the rate of 1800 Rs per hour. The FashionPhotographer class (a kind of ProductPhotographer and ArtPhotographer) provides its own implementation of calRemuneration and getRemuneration functions, and a parameterized constructor. The fashion photographer charges for his services using 1000 Rs per hour plus 2000 Rs per product. In the main function, create a product photographer, an art photographer, and a fashion photographer. The product photographer Mr Usman photographed 7 different furniture items. Mr Ahmed (the art photographer) photo shot for performing arts for 8 hours. The fashion photographer Mr Daud photographed a fashion wear brand for 4 hours covering 15 different cloth wear items. The main function should use a dynamic binding concept to invoke calRemuneration, getRemuneration, and getName functions for these 3 types of photographers separately. The typical program output should be as follows: Product Photographer USMAN earned: 21000 ——————————————— Art Photographer AHMED earned: 14400 ——————————————— Fashion Photographer DAUD earned: 34000 Show transcribed image text 1) Consider A (15,5) Linear Block Code (cyclic) In Systematic Form. The Generator Polynomial Transcribed Image Text from this Question1) Consider a (15,5) linear block code (cyclic) in systematic form. The generator polynomial is given as g(x) = 1 x x2 x5 x x10. a. Design and draw the circuit of the feedback shift register encoder and decoder.(6 Marks) b. Use the encoder obtained in part a to find the code word for the message 01110 (Assume the right most bit is the earliest bit) (5 Marks) c. Repeat the steps of part b for decoding. (5 Marks) d. Verify the codeword obtained in part b polynomial division method (5 Marks) e. Consider a codeword C = ( 110110010101100 Is this a codeword of the above system? Provide suitable justification for your answer. (4 Marks)

Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
The price is based on these factors:
Academic level
Number of pages
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more