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

  Designing a mobile computing application

As using the GPS is battery consuming, the app should also be sensitive to battery levels and perhaps stop GPS based tracking or disallow tracking or warn the user if battery levels are too low - When a tracked path is saved, LTUPersonalLogger shou..

  A squab is meant to represent a creature in a computer game

A Squab is meant to represent a creature in a computer game that is played on a rectangular grid. Positions on the grid are specified by two coordinates (x and y). Directions are represented by four letters: N, S, E and W. Movement in direction E cau..

  Program a maze-type game using assembly language

Project requires you to program a maze-type game using Assembly Language, it is not acceptable to use any other programming language for this project

  Write functions to do several types of string processing

Write functions to do several types of string processing. To test these you must write driver programs USING C++ without any errors and it has be executed properly.

  Create a java application for employee class

Create a Java application, that support the following:- Create an Employee class, which holds following information: Employee First Name, Employee Last Name.

  Run the program with a file name

Write a short Python program that asks the user to input two numbers, and then divides the first number by the second. The program must use an exception handling structure to process the situation when the denominator is zero. Run your program wit..

  Front end applications

How does a compiled binary executable store on the client computer?

  Find the titles of the records

Find all triplets of libraries that are collocated.

  Write program which prints question and reads user input

Write the program which prints question "Do you want to continue?" and reads user input. If user input is "Y", "Yes", "OK", "Sure", or "Why not?", print out "OK".

  Construct a markov algorithm

Construct a Markov Algorithm that will reverse the order of an input string that consists of zero or more upper case letters - It will always have the following effect: whatever is on the RHS of that rule (except the period, if there is one) will b..

  Write accessors for each of the declared class variables.

Read the file and display in the listbox each record splitting out the fields, eliminating the comma delimiters and placing spaces between the fields.

  Write the psuedocode showing the logic for a program

Write the psuedocode showing the logic for a program that allows a user to enter 12 numbers and then displays them in the reverse order of their entry

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