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

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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