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 6553857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:37:52+00:00 2026-05-25T12:37:52+00:00

Here’s the problem. Write a function for merging multiple (sorted) linked lists into one

  • 0

Here’s the problem.

Write a function for merging multiple (sorted) linked lists into one sorted linked list. This
function should access the elements through Iterator interface (do not access elements
through the linked list directly). The arguments to the merge procedure are an array of
Iterators and the size of the array. The return value should be another Iterator with an
underlying List implementation.

Steps:

(1) Implement linked list with iterator interface.
Define the Element in the list as below:

typedef struct
{
int idno;
char name[25];
float marks;
} Element;

(a) List createList();

(b) List insert(List L, Element e );

(c) Void printList(List L);

(d) iterator initIterator(List L);

(e) boolean hasMoreElements(iterator I);

(f) iterator moveNext(iterator I);

(2) Implement Merge function.

iterator merge(iterator I[],int size)

This function will merge the elements in all the lists ordered by the attribute
“marks”. Merge function should access the list through the iterator functions.

(3) Implement driver function.

Populate the lists from the input files (provided as support). Call the merge
function and store the data in resultant merged list to an output file.

Support files: test1.txt, test2.txt, test3.txt, test4.txt, test5.txt, test6.txt, test7.txt, test8.txt

Deliverables: dataDef.h, mergeOps.c, mergeOps.h, main.c, output.txt

Now i dont want the solution for this, but i want to know what an iterator interface is.
I have never heard of it before.

And how do i go about implementing linked list with iterator interface.What does it mean?

Also it uses a data type of iterator what that would be?

  • 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-05-25T12:37:52+00:00Added an answer on May 25, 2026 at 12:37 pm

    An iterator is simply a generalized term for something that allows you to traverse a container (like an array, list, etc).

    From wikipedia,

    In computer programming, an iterator is an object that enables a
    programmer to traverse a container. Various types of iterators are
    often provided via a container’s interface. Though the interface and
    semantics of a given iterator are fixed, iterators are often
    implemented in terms of the structures underlying a container
    implementation and are often tightly coupled to the container to
    enable the operational semantics of the iterator. Note that an
    iterator performs traversal and also gives access to data elements in
    a container, but does not perform iteration (i.e., not without some
    significant liberty taken with that concept or with trivial use of the
    terminology). An iterator is behaviorally similar to a database
    cursor.

    As your assignment talks about creating an iterator without access the elements directly, you can have a look at Iterator Design Pattern

    More information on Iterator

    • Iterator implementation in C
    • Iterator pattern in OOP
    • Do we still need Iterator design pattern?
    • Iterator design pattern in C#
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's a problem I ran into recently. I have attributes strings of the form
Here's a coding problem for those that like this kind of thing. Let's see
Here’s a problem I’ve really been struggling with. I need to merge two sorted
Here's an interesting problem. On a recently installed Server 2008 64bit I opened IE
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
Here's an excerpt from java.text.CharacterIterator documentation: This interface defines a protocol for bidirectional iteration
Here is my code. My question has to do with the append function inside
Here's a basic regex technique that I've never managed to remember. Let's say I'm
Here is the issue I am having: I have a large query that needs
Here's my scenario - I have an SSIS job that depends on another prior

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.