Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write an implementation of the C strlen function from scratch. Recall strlen returns the length of the string pointed to by str . size _

Write an implementation of the C strlen function from scratch. Recall strlen returns the length of the string pointed to by str.
size_t strlen(const char *str)
Write a recursive Scheme form (whereis x lst) which returns the location of the first occurrence of x in lst. If x is not in the list you can return any invalid location (eg.-1 or length+1). It is up to you whether to use 0- or 1-based indexing.
Write a Prolog program split(L, N, L1, L2) where L1 and L2 are the result of splitting the list L after location N.
Write a Scheme program (increasing lst) which returns a list that is lst with any elements removed that are not greater than the ones preceding it. For example:
(increasing '())->()
(increasing '(1))->(1)
(increasing '(1-23-45))->(135)
(increasing '(54321))->(5)
(increasing '(12345))->(12345)
Write a procedure that takes a list/array of numbers and adds the index of the location to each number in the list/array. For example: 1,2,3->1,3,5(or 2,4,6)
C (array)
C++(vector)
Scheme
Prolog

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 11 The Ultimate Database For Cloud Analytics And Mobile

Authors: John Campbell, Chris Crone, Gareth Jones, Surekha Parekh, Jay Yothers

1st Edition

1583474013, 978-1583474013

More Books

Students also viewed these Databases questions

Question

2. What are the components of IT infrastructure?

Answered: 1 week ago