top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

Implement the following functions recursively in the code linked list type

0 votes

int seqSearch(int key); // this is a member function of the linkedListType class. It searches for the value key in the linked list. If the key is found, then its position is returned. Otherwise, -1 is returned. NOTE: in order to implement this function, you need to implement another private member function to send it the first pointer. Here is the prototype for the private member function:

int recSeqSearch(nodeType *p, int key);

#include <iostream>
using namespace std;

struct nodeType
    int info;
    nodeType *next;

class linkedListType
    int listSize();
    bool isEmpty();
    int seqSearch(int);
    void remove(int);
    void insertFirst(int);
    void insertEnd(int);
    void insertAt(int, int);
    void removeAt(int);
    void print();
    void clearList();
    void insertOrdered(int);
    void removeFirst();
    void removeLast();
    void removeLast2();
    int removeOddSumEven();

    nodeType *first, *last;
    int length;
posted Nov 23, 2013 by As M Ob

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button
Not sure about recursion but you can take a look at open implementations  they might have few of them in recursion.

Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.