Write a program that implements quicksort

Assignment Help Programming Languages
Reference no: EM131218501

Part A-

1. What arguments can you make for the idea of a single programming language for all programming domains?

It would be ideal to have a single programming language for all

2. What arguments can you make against the idea of a single programming language for all programming domains?

3. What are the arguments for writing efficient programs even though hardware is relatively inexpensive?

4. Describe some design trade-offs between efficiency and safety in some language you know.

Part B-

1. Which of the three original goals of ALGOL design committee, in your opinion, was the most difficult to achieve at that time?

2. Make an educated guess as to the most common syntax error in Lisp programs.

3. Describe, in your own words, the concept of orthogonality in programming language design.

4. What are the arguments both for and against the idea of typeless language?

5. What is your opinion of the argument that languages that are too complex are too dangerous to use, and we should therefore keep all languages small and simple?

6. Why, in your opinion, do new scripting languages appear more frequently than new compiled languages?

Part C - Programming exercise

1. To understand the value of records in a programming language, write a small program in a C-based language that uses an array of structs that store student information, including name, age GPA as a float and a grade level as a string (e.g., "freshmen" etc). Also, write the same program in the same language without structs

2. To understand the value of recursion in a programming language, write a program that implements quicksort, first using recursion and then without recursion

Chapter 3

1. Us the grammar in example 3.2, show a parse tree and a leftmost derivation for each of the following statements

a. A = A * (B + (C * A))

b. B = C * (A * C + B)

c. A = A * (B + (C) )

2. Prove that the following grammar is ambiguous

a. <S> -><A>

b. <A> -><A> + <A> |<id>

c. <id> -> a|b|c

3. Describe, in English, the language defined by the following grammar:

a. <S> -><A><B><C>

<A> -> a <A> | a

<B> -> b <B> |b

<C> -> c <C> | c

4. Consider the following grammar:

a. <S> -><A> a <B> b

<A> -><A> b | b

<B> -> a <B> | a

Which of the following sentences are in the language generated by this grammar?

a. baab

b. bbbab

c. bbaaaaaS

d. bbaab

5. Write a grammar for the language consisting of strings that have n copies of the letter a followed by the same number of copies of the letter b, where n > 0. For example, the strings ab, aaaabbbb, and aaaaaaaabbbbbbbb are in the language but a, abb,ba and aaabb are NOT.

6. Compute the weakest precondition for each of the following assignment statements and postconditions:

a. A = 2 * (b -1) - 1 {a > 0}

b. B = (c + 10) / 3 {b > 6}

c. A = a + 2 * b - 1 {a > 1}

d. X = 2 * y + x - 1 {x > 11}

Part D-

1. Perform the pairwise disjointness test for the following grammar rules.

a. A -> aB |b |cBB

b. B -> aB |bA| aBb

c. C -> aaA |b | caB

2. Perform the pairwise disjointness test for the following grammar rules.

a. S -> aSb | bAA

b. A -> b{aB} | a

c. B -> aB | a

3. Show a trace of the recursive decent parser given in Section 4.4.1 for the string a + b * c.

4. Show a trace of the recursive decent parser given in Section 4.4.1 for the string a * (b + c)

Part E- Programming excersises:

1. Design a state diagram to recognize the floating-point literals of your favorite programming language.

2. Write and test the code to implement the state diagram of problem 2.

Reference no: EM131218501

Questions Cloud

Explain the notion of head of a phrase by analyzing elements : Explain the notion of the head of a phrase by analyzing the internal elements of NP, VP, AP, ADVP, and PP. What does it mean by saying that each phrase category must contain a head.
Philadelphia flyers games are frequently sold out : Philadelphia Flyers games are frequently sold out, and a waiting list exists for the right to purchase season tickets. What would be the welfare effects of a $1 tax on tickets? Explain
Construct an argument supporting your proposed solution : Identify the global societal problem within the introductory paragraph and conclude with a thesis statement that states your proposed solution(s) to the problem. For guidance on how to construct a good introduction paragraph, please review the Int..
How consumers use these indicators as part of the qi process : Analyze at least three indicators in detail and how consumers use these indicators as part of the QI process.
Write a program that implements quicksort : To understand the value of recursion in a programming language, write a program that implements quicksort, first using recursion and then without recursion
Identical products and have same constant marginal cost : If firms produce identical products and have the same constant marginal cost, m, explain why the Nash-Bertrand equilibrium price and market quantity are the same regardless of whether there are two or more firms.
Growth rate of real gdp was then what : Nominal GDP growth in the US in 2011 was (about) 6.8%, while ina´ation was (about) 2.2%. The growth rate of real GDP was then what?
What larger themes or issues are addressed : What larger themes or issues are addressed-- religious, philosophical, political, etc.? What patterns can you find? Are there allusions present to other poetic works, myths, historical/religious figures, etc.?
Create a swot analysis for the company : Assess efforts by this corporation to be a responsible (ethical) corporate citizen and determine the impact these efforts (or lack thereof) have on the company's bottom line. Provide specific examples to support your response.

Reviews

len1218501

9/24/2016 5:22:17 AM

In this Programming Languages assignment Please answer as many as possible. The verbal responses are less important as they are opinions and consequently worth less per question.

Write a Review

Programming Languages Questions & Answers

  Develop html5 pages themed on manchester

Design and develop three HTML5 pages themed on Manchester. The pages should be optimised for delivery on a tablet.

  Create a windows form application project.

Add an Enter Friend button which will process the entries made in the textboxes; writing each entry to a file and an Exit button which will exit the application

  Employee wage data application

A small company is moving all its employee data to a computer. To make a smooth transition, a software program will permit the data entry personnel to enter data into a file. Design a program that writes the employees.dat file

  Function to count number of times the given number occured

Write a main function to input 20 integers in the range of 1 to 6. Write a function to count the number of times the numbers 2 and 5 occur. The function should declare static variables count2 and count5.

  One-dimensional as array of counters to solve problem

Write program which determines how many salespeople earned salaries in each of following ranges. Use the one-dimensional as the array of counters in solving this problem

  Write a program that creates a scintillation grid

Write a program that creates a scintillation grid

  Discuss the merits and weaknesses of interpreting,compiling

Interpreted code executes much more slowly than compiled code, yet several systems use them extensively. The most well known are Visual Basic (it has two modes: interpreter mode and compiler mode), JavaScript and the special case of interpretation..

  Windows and unix file management systems

From the first e-Activity, evaluate the efficiency, speed, and accuracy of the storage and retrieval techniques that two (2) search engine organizations currently use.

  Write a recursive function which accepts a string

Write a recursive function which accepts a string and its length and determines if the string is a palindrome. A palindrome is a string that reads the same frontwards and backwards.

  Populate data to the tables in your database

Retrieve the contact details of library customers

  Specific changes made for different countries-sites directed

Why were these specific changes made for different countries at whom the sites were directed? Is there anything else you would consider changing.

  Create application displays number of square feet in house

Create application displays number of square feet in house. Explain and initialize the length and width of the house to 37 and 22, respectively.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd