Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7850137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:45:33+00:00 2026-06-02T18:45:33+00:00

I have a list L=(1 j 3 k 4 h 5 n 6 w)

  • 0

I have a list

 L=(1 j 3 k 4 h 5 n 6 w)

I need to do a function Verify that will verify if the first atom is before the 2nd.
I want to verify this:

> Verify(3 k)

result should return

> T

// because atom ‘3’ is before atom ‘k’

And in this case :

>Verify(h 4)

result should return

> NIL

// because atom ‘h’ is after atom ‘4’

I have to check position of each element and compare positions

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T18:45:36+00:00Added an answer on June 2, 2026 at 6:45 pm

    What dialect of Lisp are you using? Here are some pointers on how to derive a solution, fill-in the blanks:

    (define (verify lst a b)
            ; what happens if there's only one element left in the list?
      (cond ((null? (cdr lst)) <???>)
            ; how do we check if the current element is equal to the `a` parameter
            ; and the next element is equal to the `b` parameter?
            (<???> T)
            ; how do we continue traversing the rest of the list?
            (else (verify <???> a b))))
    
    ;;; tests
    
    (define lst '(1 j 3 k 4 h 5 n 6 w))
    
    (verify lst 3 'k)
    > T
    (verify lst 'h '4)
    > F
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a function that returns two values in a list. Both values need
I've been playing with Python and I have this list that I need worked
I have this form with a JS function to verify that there are no
I need function, that returns list of strings. I have data in table like
I need a function that will take in a list of characters and numbers,
I have a function where I get a list of ids, and I need
I have a list of callback functions that I need to invoke when an
I have a list that I need to send through a URL to a
I have List[(String,String)] and I need to sort them by the 2nd value and
I have two List's that contain a object of Tag like List i need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.