Unnesting parentheses in Lisp
I want to write code (using recursive function) to unnest the parentheses in a LIST in Lisp language. Example: (unnest '(1 (2 (3)) (4 5))) ==> (1 2 3 4 5) Thanks. Any help is appreciated! ...
I want to write code (using recursive function) to unnest the parentheses in a LIST in Lisp language. Example: (unnest '(1 (2 (3)) (4 5))) ==> (1 2 3 4 5) Thanks. Any help is appreciated! ...
hey everyone... so i'm working on a database design class for university. I've got the question below and my attempt at the diagram here http://tinypic.com/view.php?pic=httchc&s=3.. would anyone mind taking a look and offering suggestions? thanks for the help!! QUESTION: Question 3 The following situation describes a company that ...
the question is Which of the following methods for providing explicit names for the columns in a view work? a. Include a column list b. Provide column aliases in the view SELECT statement c. Rename the columns when you select from the view answer a. Works: Include a column list b. Works: Provide column aliases in the view SELECT stat...
I have 3 functions: f(n)=2n, g(n)=n! and h(n)=nlog(n) (log(n) is base 2). Comparing f(n) and g(n): The factorial function, g(n) can be approximated as O(nn) (poor upper bound). Considering this, Is g(n)=Ω(f(n)) ? How would I compare g(n) and h(n), and f(n) and h(n)? ...
when I try to open a file for reading in my console application i get this error message: "Unhandled exception at 0x1048766d (msvcp90d.dll) in homework1.exe: 0xC0000005: Access violation writing location 0x00000000." It works fine when I compile and run the program on my macbook but when I run it on my desktop using VS 2008 it gives me ...
Hi, please, could someone explain to me a few basic things about working with languages like C? Especially on Windows? If I want to use some other library, what do I need from the library? Header files .h and ..? What is the difference between .dll and .dll.a.? .dll and .lib? .dll and .exe? What is .def? Does it matter how was the lib...
Optional assignment for one of my classes. 30-45 minute presentation/case study on either of these two topics: Examples of currently existing design patterns in real life projects: what problem they solve, why are they better than other techniques, etc New design patterns, what problems they solve that other design patterns can't, etc ...
I generated 100 random numbers from 0-9, i am supposed to count how many times each number appears. Storing it in an array of 10 integers and count it. heres what i have so far, i cant figure out the count part Random r = new Random(); int[] integers = new int[100]; for (int i=0; i<integers.length; i++) { integers[i] = (r...
Why the following code could/will result in infinite loop? x=0; y=0; while(x<100) { minnum=100; maxnum=100; while(y<150) { if(random[x][y]<minnum) { minnum=random[x][y]; minX=x; minY=y; y++; } else if(random[x][y]>maxnum) { maxnum=random[x][y]; maxX=y...
I have a problem at school. I'm new to programing and I need some help. Please complete the dotted line: import java.net.*; import java.io.* public class Test{ public static void main (String arg[]} int x=0; try { ServerSocket s=new ServerSocket ( k ); s.close(); } catch (..........................) ...
I'm trying to work on a homework assignment based on the old song, I'm my own grandpa. So, I've started out defining rules for who a son, daughter, father, father_in_law, etc was. However, something must be wrong with the order of my rules/facts because every time I load it I get the following errors: GNU Prolog 1.3.1 By Daniel D...
I have a content of strings and I have to reverse the order using python. the content is Python Java microsoft ...
Hi This is for a simple web-page assignment. I have a few pages on which I would like to display the same list of links in a sidebar and so have made the following javascript: document.getElementByid('list').innerHTML = '<a href=\"index.html\">Main Page</a>'+ '<a href=\"benefits.html\">Benefits</a>'+ '<a href=\"facts.html\">Shocking St...
Hi I am new to JSP and i am trying to write the below code... <%@ page import="java.io.*" %> <%@ page import="com.wipro.assignment2.exceptions.UploadFileNotFoundException" %> <% String requestPath=request.getParameter("file1"); System.out.println("I am printing before SUBMIT button click"); if(requestPath!=null) { ...
What does this piece of code in C do: p = (1, 2.1); What do we know about p? ...
I am a newbie and seeking for the Zen of Python :) Today's koan was finding the most Pythonesq way to solve the following problem: Permute the letters of a string pairwise, e.g. input: 'abcdefgh' output: 'badcfehg' ...
The following story is from N. Wirths (1976) Algorithsm + Datastructures = Programs. I married a widow (let's call her W) who had a grown-up daughter (call her D). My father (F), who visited us quite often, fell in love with my step-daughter and married her. Hence, my father became my son-in-law and my step-daughter bec...
i have one table and one column in this.there is 15 data(integer).i want to count positive numbers and negative numbers and also sum of total numbers in one query . can any one help me ......... ...
Hi, as far as I can see, you can do: Find the node to remove. node.previous.next = node.next node.next.previous = node.previous node.previous = null node.next = null Dispose of node if you're in a non-GC environment If your list is a double linked. But how do you do it with a single linked list? I have tried a lot of things, with no...
Hello, I have this code: int foo(int n) { int x=2; while (x<n) { x = x*x*x; } return x; } Now, i need to analyze its time complexity. I noticed it reaches n much faster than just log(n). I mean, it does less steps than O(log(n)) would do. I read the answer but have no idea how they got to it: It is O(log(...