Computer-based methods for determining the head of a linked list
First Claim
1. A computer system comprising:
- a processing unit;
a memory connected to the processing unit;
a linked list comprising a plurality of elements each stored at a different location in said memory, each stored element of the linked list comprising information and a pointer that points to a next subsequent stored element in the linked list,the processing unit being programmed to;
a) retrieve one of the stored elements of the linked list from said memory;
b) identify, from the pointer of said retrieved element, the next subsequent stored element of the linked list;
c) mark said next subsequent stored element;
d) repeat steps (a) through (c) for each other stored element of the list; and
thereafter,e) identify which of said stored elements is not marked, and designate the stored element that is not marked as a head of the linked list,whereby the processing unit is able to identify the head of the linked list when such information has been lost or is inaccessible.
9 Assignments
0 Petitions
Accused Products
Abstract
A computer-based method for identifying the head of a linked list stored in a memory comprises the steps of (a) retrieving an element of the list from the memory, (b) identifying from the pointer of the retrieved element, the next subsequent stored element of the list, (c) marking the next subsequent stored element; and (d) repeating steps (a) through (c) for each stored element of the list. After processing each element, the stored element that is not marked is identified as the head of the linked list. In an alternate embodiment, an element of the list is selected as a possible candidate for head of the list, and the list is then traversed from the selected element to the end of the list. A count of the number of linkages between the selected element and the end of list is generated as the list is traversed, and each element accessed while traversing the list is marked "visited". Each other element of the list is then processed in the same manner, except that elements already visited are not processed. Additionally, if while traversing the linkages from a candidate element to the end of the list, an element is encountered that was previously "visited", then the linkage count associated with the previously visited element is added to the linkage count generated up until that point for the candidate element. Upon completion, the element with the largest linkage count is identified as the head of the list.
9 Citations
10 Claims
-
1. A computer system comprising:
-
a processing unit; a memory connected to the processing unit; a linked list comprising a plurality of elements each stored at a different location in said memory, each stored element of the linked list comprising information and a pointer that points to a next subsequent stored element in the linked list, the processing unit being programmed to; a) retrieve one of the stored elements of the linked list from said memory; b) identify, from the pointer of said retrieved element, the next subsequent stored element of the linked list; c) mark said next subsequent stored element; d) repeat steps (a) through (c) for each other stored element of the list; and
thereafter,e) identify which of said stored elements is not marked, and designate the stored element that is not marked as a head of the linked list, whereby the processing unit is able to identify the head of the linked list when such information has been lost or is inaccessible. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
7. A computer system comprising:
-
a processing unit; a memory connected to the processing unit; a linked list comprising a plurality of elements each stored at a different location in said memory, each stored element of the linked list comprising information and a pointer that points to a next subsequent stored element in the linked list, the processing unit being programmed to; a) select one of said stored elements from said memory; b) traverse successive linkages of the list from the selected element to the end of the list, mark each stored element accessed during said traversal including the selected element, and generate, for the selected element, a linkage count representing the number of linkages traversed from the selected element to the end of the list; c) repeat steps (a) and (b) for each of the other stored elements of the list, but only if said other stored element was not marked during a previous traversal of the list; and d) identify the stored element for which a largest linkage count was generated, and designate the identified element as a head of the linked list, whereby the processing unit is able to identify the head of the linked list when such information has been lost or is inaccessible. - View Dependent Claims (8, 9, 10)
-
Specification