Linear Search

Problems

Problem : You are given an array of linked lists (each element in the array points to a linked list), as follows:

typedef struct _list_t_ {
int data;
struct _list_t_ *next;
} list_t;

list_t *arr[100];
Write a function to find the largest data element in any of the lists.

Problem : You are given a malformed linked list in which one of the list element's next pointer points back to the same element. Write a function to return a pointer to the list structure with the incorrect next pointer.

Problem : You are given a pointer to somewhere in the middle of a doubly-linked list of integers:

typedef struct _list_t_ {
int data;
struct _list_t_ *next;
struct _list_t_ *prev;
} list_t;

Find the largest element in the list.

Problem : If a linked list were in sorted order, would you be able to write a search routine that worked in less than O(n) time?

Problem : Given a singly-linked list, return a pointer to the first element whose data field is less than or equal to the data element of the last value in the list.

Take a Study Break

What's your Pretty Little Liars name?

Take this quiz to find out!

Which young actress just got married?

Click to find out!

Cat bearding WINS THE INTERNET

Have you seen this yet?

Scary movies with funny posters

These. Are. Hilarious.

Geeky Actors: Then and Now

Travel back in time!

Villains We Want These Actresses to Play

From super cute to super bad!

10 Movies Better Than Their Books

What do you think?