Linked Lists, Arrays (Discussion 3) (Danh sách liên kết và mảng) - Christine Zhou
Tài liệu thảo luận về danh sách liên kết và mảng, bao gồm ôn tập SLLists, DLLists và các bài tập thực hành.
미리보기 생성 중...
Discussion 3: Linked Lists & Arrays Christine Zhou Agenda Administrivia Review of SLLists SLList problems (1.1, 1.2) Review of arrays Array problems (2.1, 2.2) Preface Lots of questions on the discussion today. These are for practice! We will not be able to get through all of them. Administrivia Project 1A due this Friday! Implementing deque interface, highly recommend to use Java Visualizer. Start early!! Office hours: pay special attention to the locations! CSM sign-ups will open tonight, 9pm, and is first come first served! Opportunity to get extra help in a small-group setting with a mentor. Pre-semester advising still available @414 (Email me!) Choose Mentor GSI’s and see the automated extension system at registration.datastructur.es Survey: tinyurl.com/cz-disc3-sp19 (please fill this out so I know what to focus on today!) Review: IntList public class IntList { public int first; public IntList rest; public IntList(int f, IntList r) { first = f; rest = r; } ... } Our IntList! What’s wrong with it? All the fields are public Calling each link an IntList does not seem entirely correct... Review: SLList Access modifiers changed to private Outside users cannot access fields directly public class SLList { Hides the internals using encapsulation private class IntNode { Hide the inner workings of the list from the private int item; user, store info about the list (ex. size) private IntNode next; private IntNode(int i, IntNode - n) User sees the list as a whole, not the { individual nodes of the list, and does not item = i; have to deal with logic of pointer next = n; manipulation } Analogy: You refer to a train as a whole, not as } individual cars. Instead of dealing with the raw private IntNode first; public SLList(int x) { links with first and next, you refer to it as a first = new IntNode(x, null); whole. } public int get(int position) { ... } Review: SLList Diagram We add a size variable so we don’t have to step through t
… 전체 문서를 읽으려면 원본 파일을 다운로드하세요.
- 문서명
- Linked Lists, Arrays (Discussion 3) (Danh sách liên kết và mảng) - Christine Zhou
- 학교 / 강의
- University of California, Berkeley · Lập trình Java
- 내용
- Tài liệu ôn tập về danh sách liên kết (SLList) và mảng, giới thiệu sentinel node, và đưa ra các bài tập thực hành về chèn và đảo ngược danh sách liên kết.
- 목차
- Agenda
- Preface
- Administrivia
- Review: IntList
- Review: SLList
- Review: SLList Diagram
- Review: SLList
- Review: Sentinel Node Diagram
- 1.1) SLList.insert
- 1.2) SLList.reverse
- Review: DLLists
- 페이지 수
- 28 페이지
- 업로더
- Giang Le
자주 묻는 질문
이 문서는 무료인가요?
네. “Linked Lists, Arrays (Discussion 3) (Danh sách liên kết và mảng) - Christine Zhou” 문서는 무료입니다. 로그인 후 '다운로드'를 클릭하여 원본 파일을 받으세요.
이 문서는 몇 페이지로 되어 있나요?
이 문서는 28페이지입니다, Lập trình Java 과정용. 다운로드하기 전에 온라인으로 미리 볼 수 있습니다.
다운로드하기 전에 미리 볼 수 있나요?
네. 이 페이지의 온라인 리더를 통해 문서를 미리 본 후 다운로드 여부를 결정할 수 있습니다.

댓글 (0)
댓글이 없습니다. 첫 댓글을 남겨보세요!